From 33ad8374da5d782d174c70a9023d181378151040 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 26 Aug 2013 07:41:36 +0000 Subject: player: break out gracefully if a file is totally unplayable Sometimes we'll enqueue the wrong file and avconv won't be able to handle it. --- lib/dtas/player.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb index 5cc95c7..d865239 100644 --- a/lib/dtas/player.rb +++ b/lib/dtas/player.rb @@ -344,10 +344,10 @@ class DTAS::Player # :nodoc: case source_spec when String - @current = try_file(source_spec) + @current = try_file(source_spec) or return echo(%W(file #{@current.infile})) when Array - @current = try_file(*source_spec) + @current = try_file(*source_spec) or return echo(%W(file #{@current.infile} #{@current.offset_samples}s)) else @current = DTAS::Source::Cmd.new(source_spec["command"]) -- cgit v1.2.3-24-ge0c7