about summary refs log tree commit homepage
path: root/lib/dtas
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-01-24 23:49:39 +0000
committerEric Wong <e@80x24.org>2016-01-25 00:09:15 +0000
commit7bfed9258bfeae89bab5939be749d07592b9f49c (patch)
tree4e245cece062871c6b252e8ed68392819620465b /lib/dtas
parentc314a0e7b845fd50997e06f97e5bffcb9c4b7732 (diff)
downloaddtas-7bfed9258bfeae89bab5939be749d07592b9f49c.tar.gz
The @last_failed state is in the parent object, not the dup-ed
object we fork off of.
Diffstat (limited to 'lib/dtas')
-rw-r--r--lib/dtas/source/sox.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/dtas/source/sox.rb b/lib/dtas/source/sox.rb
index c4c65aa..9d128a6 100644
--- a/lib/dtas/source/sox.rb
+++ b/lib/dtas/source/sox.rb
@@ -21,8 +21,7 @@ class DTAS::Source::Sox # :nodoc:
   )
 
   # we use this to be less noisy when seeking a file
-  @last_failed = nil
-  def self.try_to_fail_harder(infile, s, cmd)
+  def try_to_fail_harder(infile, s, cmd)
     msg = nil
     case s
     when %r{\A0\s*\z} then msg = "detected zero samples"
@@ -37,6 +36,7 @@ class DTAS::Source::Sox # :nodoc:
   end
 
   def initialize
+    @last_failed = nil
     command_init(SOX_DEFAULTS)
   end
 
@@ -45,7 +45,7 @@ class DTAS::Source::Sox # :nodoc:
     cmd = %W(soxi -s #{infile})
     s = qx(@env.dup, cmd, err_str: err, no_raise: true)
     return if err =~ /soxi FAIL formats:/
-    self.class.try_to_fail_harder(infile, s, cmd) or return
+    try_to_fail_harder(infile, s, cmd) or return
     source_file_dup(infile, offset, trim)
   end