From 83ab812ea560f5f327ea2df00f8f0292d96b1795 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 4 Jan 2016 09:51:41 +0000 Subject: player: replaygain: avoid unnecessary ignoring It is possible for a file to only have one of the ReplayGain tags we need and not the previous-required REPLAYGAIN_TRACK_GAIN tag. So do not reject the entire series of tags if a file has the one we want. --- test/test_source_av.rb | 4 ++-- test/test_source_sox.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/test_source_av.rb b/test/test_source_av.rb index 3106fe9..6047de7 100644 --- a/test/test_source_av.rb +++ b/test/test_source_av.rb @@ -35,7 +35,7 @@ class TestSourceAv < Testcase x(%W(metaflac --add-replay-gain #{tmp.path})) source = DTAS::Source::Av.new.try(tmp.path) assert_equal source.comments["FOO"], "BAR", source.inspect - rg = source.replaygain + rg = source.replaygain('track_gain') assert_kind_of DTAS::ReplayGain, rg assert_in_delta 0.0, rg.track_peak.to_f, 0.00000001 assert_in_delta 0.0, rg.album_peak.to_f, 0.00000001 @@ -61,7 +61,7 @@ class TestSourceAv < Testcase end source = DTAS::Source::Av.new.try(a.path) - rg = source.replaygain + rg = source.replaygain('track_gain') assert_kind_of DTAS::ReplayGain, rg assert_in_delta 0.0, rg.track_peak.to_f, 0.00000001 assert_in_delta 0.0, rg.album_peak.to_f, 0.00000001 diff --git a/test/test_source_sox.rb b/test/test_source_sox.rb index ce4fe93..05ea9a8 100644 --- a/test/test_source_sox.rb +++ b/test/test_source_sox.rb @@ -35,7 +35,7 @@ class TestSource < Testcase x(%W(metaflac --set-tag=FOO=BAR #{tmp.path})) x(%W(metaflac --add-replay-gain #{tmp.path})) assert_equal source.comments["FOO"], "BAR" - rg = source.replaygain + rg = source.replaygain('track_gain') assert_kind_of DTAS::ReplayGain, rg assert_in_delta 0.0, rg.track_peak.to_f, 0.00000001 assert_in_delta 0.0, rg.album_peak.to_f, 0.00000001 @@ -62,7 +62,7 @@ class TestSource < Testcase end end - rg = source.replaygain + rg = source.replaygain('track_gain') assert_kind_of DTAS::ReplayGain, rg assert_in_delta 0.0, rg.track_peak.to_f, 0.00000001 assert_in_delta 0.0, rg.album_peak.to_f, 0.00000001 -- cgit v1.2.3-24-ge0c7