spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 6a0d525fe401f438fdabebec62496feb92dc9881
parent 4e683c33240bbe3e684883c605204ee02efa38b0
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Thu, 28 Mar 2013 10:17:58 -0700

tests: Musepack demuxing/decoding

Diffstat:
Msrc/spek-audio.cc | 5+++--
Atests/samples/2ch-44100Hz-std.mpc | 0
Mtests/test-audio-info.cc | 1+
Mtests/test-audio-read.cc | 1+
4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/spek-audio.cc b/src/spek-audio.cc @@ -136,8 +136,9 @@ std::unique_ptr<AudioFile> Audio::open(const std::string& file_name) // APE uses bpcs, FLAC uses bprs. bits_per_sample = codec_context->bits_per_coded_sample; } - if (codec_context->codec_id == AV_CODEC_ID_AAC) { - // AAC decoder sets both bps and bitrate. + if (codec_context->codec_id == AV_CODEC_ID_AAC || + codec_context->codec_id == AV_CODEC_ID_MUSEPACK8) { + // These decoders set both bps and bitrate. bits_per_sample = 0; } if (bits_per_sample) { diff --git a/tests/samples/2ch-44100Hz-std.mpc b/tests/samples/2ch-44100Hz-std.mpc Binary files differ. diff --git a/tests/test-audio-info.cc b/tests/test-audio-info.cc @@ -73,6 +73,7 @@ void test_audio_info() {"2ch-44100Hz-q5.ogg", {AudioError::OK, "Vorbis", 160000, 44100, 0, 2, 0.1}}, {"2ch-44100Hz.dts", {AudioError::OK, "DCA", 1411200, 44100, 0, 2, DCA_T}}, {"2ch-44100Hz.ac3", {AudioError::OK, "ATSC A/52", 192000, 44100, 0, 2, AC3_T}}, + {"2ch-44100Hz-std.mpc", {AudioError::OK, "Musepack", 0, 44100, 0, 2, 0.0}}, }; for (const auto& item : files) { run( diff --git a/tests/test-audio-read.cc b/tests/test-audio-read.cc @@ -63,6 +63,7 @@ void test_audio_read() {"2ch-44100Hz-q5.ogg", 2 * 1024 * 4 + 1152}, {"2ch-44100Hz.dts", 10240}, {"2ch-44100Hz.ac3", 9 * 1024}, + {"2ch-44100Hz-std.mpc", 11 * 1024 + 256}, }; for (const auto& item : files) { run(