From 3f8e20d745a8163bd9b199e0047bf98a952ed092 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 27 Aug 2013 20:03:24 +0000 Subject: av_ff_common: zero samples on streams of unknown length It's possible to get zero samples when playing streams of unknown length (e.g. over Icecast over HTTP) --- lib/dtas/source/av_ff_common.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/dtas/source/av_ff_common.rb') diff --git a/lib/dtas/source/av_ff_common.rb b/lib/dtas/source/av_ff_common.rb index 1d0f146..36919e6 100644 --- a/lib/dtas/source/av_ff_common.rb +++ b/lib/dtas/source/av_ff_common.rb @@ -118,6 +118,8 @@ module DTAS::Source::AvFfCommon # :nodoc: # file itself, not the decoded output def samples @samples ||= (@duration * @format.rate).round + rescue + 0 end def to_hsh -- cgit v1.2.3-24-ge0c7