diff --git a/lib/rvideo/inspector.rb b/lib/rvideo/inspector.rb index a0d0caa..3a35734 100644 --- a/lib/rvideo/inspector.rb +++ b/lib/rvideo/inspector.rb @@ -393,6 +393,7 @@ def audio_channels_string def audio_channels return nil unless audio? + return audio_match[5].to_i if (audio_match[5].to_i > 0) case audio_match[5] when "mono" @@ -400,7 +401,7 @@ def audio_channels when "stereo" 2 else - raise RuntimeError, "Unknown number of channels: #{audio_channels}" + raise RuntimeError, "Unknown number of channels: #{audio_match[5]}" end end @@ -523,7 +524,7 @@ def bitrate_match def audio_match return nil unless valid? - /Stream\s*(.*?)[,|:|\(|\[].*?\s*Audio:\s*(.*?),\s*([0-9\.]*) (\w*),\s*([a-zA-Z:]*)/.match(audio_stream) + /Stream\s*(.*?)[,|:|\(|\[].*?\s*Audio:\s*(.*?),\s*([0-9\.]*) (\w*),\s*([(\d)*a-zA-Z:]*)/.match(audio_stream) end def video_match @@ -542,4 +543,4 @@ def video_match match end end -end \ No newline at end of file +end