From 7bfed9258bfeae89bab5939be749d07592b9f49c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 24 Jan 2016 23:49:39 +0000 Subject: source/sox: try_to_fail_harder is a normal method The @last_failed state is in the parent object, not the dup-ed object we fork off of. --- lib/dtas/source/sox.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3-24-ge0c7