lib/dtas/source/av_ff_common.rb in dtas-0.1.I vs lib/dtas/source/av_ff_common.rb in dtas-0.2.0
- old
+ new
@@ -1,7 +1,7 @@
# -*- encoding: binary -*-
-# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net>
+# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
require_relative '../../dtas'
require_relative '../source'
require_relative '../replaygain'
require_relative 'file'
@@ -116,9 +116,11 @@
# This is the number of samples according to the samples in the source
# file itself, not the decoded output
def samples
@samples ||= (@duration * @format.rate).round
+ rescue
+ 0
end
def to_hsh
sd = source_defaults
to_hash.delete_if { |k,v| v == sd[k] }