diff --git a/src/spek-audio.cc b/src/spek-audio.cc index fdde397..5c1615f 100644 --- a/src/spek-audio.cc +++ b/src/spek-audio.cc @@ -136,8 +136,9 @@ std::unique_ptr 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 new file mode 100644 index 0000000..b8ef31e Binary files /dev/null and b/tests/samples/2ch-44100Hz-std.mpc differ diff --git a/tests/test-audio-info.cc b/tests/test-audio-info.cc index ff426b4..a549008 100644 --- 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 index 671c2f3..bfbc1d0 100644 --- 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(