about summary refs log tree commit homepage
path: root/lib/dtas/source/sox.rb
diff options
authorEric Wong <normalperson@yhbt.net>2013-08-26 00:35:03 +0000
committerEric Wong <normalperson@yhbt.net>2013-08-26 00:40:52 +0000
commit6d67d9c2af57233743187a92b7e651174d6eb42b (patch)
tree2c174e81b241de8d30786180e98e6d5f9979bd60 /lib/dtas/source/sox.rb
parenta1198562c51c5374a85d74e1cfe9e6a695384a3d (diff)
I forgot :err is already handled by Process.spawn, so split out
the functionality into err_str where we want to use it.

Also, add a :no_raise flag which will allow us to better handle
avprobe/soxi calls which can fail and avoid needless exceptions.
Diffstat (limited to 'lib/dtas/source/sox.rb')
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dtas/source/sox.rb b/lib/dtas/source/sox.rb
index 086b923..30e7f18 100644
--- a/lib/dtas/source/sox.rb
+++ b/lib/dtas/source/sox.rb
@@ -19,7 +19,7 @@ class DTAS::Source::Sox # :nodoc:
   def self.try(infile, offset = nil)
     err = ""
-    DTAS::Process.qx(%W(soxi #{infile}), err: err)
+    DTAS::Process.qx(%W(soxi #{infile}), err_str: err)
     return if err =~ /soxi FAIL formats:/
     new(infile, offset)
@@ -69,7 +69,7 @@ class DTAS::Source::Sox # :nodoc:
       err = ""
       cmd = %W(soxi -a #@infile)
-        qx(cmd, err: err).split(/\n/).each do |line|
+        qx(cmd, err_str: err).split(/\n/).each do |line|
           key, value = line.split(/=/, 2)
           key && value or next
           # TODO: multi-line/multi-value/repeated tags