From 168bbc3c187135c63d4245fad0a583751a751522 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 10 Jun 2015 13:23:16 +0200 Subject: [PATCH] MPEG PS: fix MPEG audio identification Part of the fix of #1242. --- src/input/r_mpeg_ps.cpp | 2 +- tests/results.txt | 1 + tests/test-498mp2_misidentification.rb | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 tests/test-498mp2_misidentification.rb diff --git a/src/input/r_mpeg_ps.cpp b/src/input/r_mpeg_ps.cpp index 77e3964b8..c2309b346 100644 --- a/src/input/r_mpeg_ps.cpp +++ b/src/input/r_mpeg_ps.cpp @@ -772,7 +772,7 @@ mpeg_ps_reader_c::new_stream_a_mpeg(mpeg_ps_id_t, track->a_channels = header.channels; track->a_sample_rate = header.sampling_frequency; - track->codec = codec_c::look_up(codec_c::type_e::A_MP3); + track->codec = header.get_codec(); } void diff --git a/tests/results.txt b/tests/results.txt index ac331aa44..92baa9a4e 100644 --- a/tests/results.txt +++ b/tests/results.txt @@ -343,3 +343,4 @@ T_494dont_abort_with_aac_error_proection_specific_config:f18d6c1a0cd91fcb216fac7 T_495default_durataion_and_sync:b360d52e56d8d291a7dc24ecd2b63c18-0a38dc656269f588fc4228d50e930d12-8f3d5eeacee5a77075eed0e7ae0d882a:passed:20150417-213623:0.894261521 T_496segment_size_0:9fd6d5e57b47693a483f9aad112a6a15-a78f5ddc1a9fb900b3797ced8752cb92:passed:20150530-180226:0.051304978 T_497crash_in_base64_decoder:f6526cfaaef01627c52ee2ba25f03255:passed:20150601-192215:0.02848152 +T_498mp2_misidentification:a7216d2e17a82182705397e2b901737d:passed:20150610-111131:0.499977541 diff --git a/tests/test-498mp2_misidentification.rb b/tests/test-498mp2_misidentification.rb new file mode 100755 index 000000000..41f15b068 --- /dev/null +++ b/tests/test-498mp2_misidentification.rb @@ -0,0 +1,6 @@ +#!/usr/bin/ruby -w + +# T_498mp2_misidentification +describe "mkvmerge / MP2 mis-identified as MP3" + +test_identify "data/mpeg12/mpeg1-misdetected-as-avc.mpg"