diff --git a/taglib/fileref.cpp b/taglib/fileref.cpp index a8c3404f..e0284c6a 100644 --- a/taglib/fileref.cpp +++ b/taglib/fileref.cpp @@ -246,8 +246,7 @@ namespace { File *file = nullptr; - if(MPEG::File::isSupported(stream)) - file = new MPEG::File(stream, readAudioProperties, audioPropertiesStyle); + if(false); #ifdef TAGLIB_WITH_VORBIS else if(Ogg::Vorbis::File::isSupported(stream)) file = new Ogg::Vorbis::File(stream, readAudioProperties, audioPropertiesStyle); @@ -300,6 +299,8 @@ namespace else if(Matroska::File::isSupported(stream)) file = new Matroska::File(stream, readAudioProperties, audioPropertiesStyle); #endif + else if(MPEG::File::isSupported(stream)) + file = new MPEG::File(stream, readAudioProperties, audioPropertiesStyle); // isSupported() only does a quick check, so double check the file here. diff --git a/tests/data/mpeg-sync-flac.flac b/tests/data/mpeg-sync-flac.flac new file mode 100644 index 00000000..6b92aae9 Binary files /dev/null and b/tests/data/mpeg-sync-flac.flac differ diff --git a/tests/test_fileref_detect.cpp b/tests/test_fileref_detect.cpp index 837c82fb..a5e74804 100644 --- a/tests/test_fileref_detect.cpp +++ b/tests/test_fileref_detect.cpp @@ -167,6 +167,7 @@ class TestFileRefDetectByContent : public CppUnit::TestFixture CPPUNIT_TEST(testSilence44SFlac); CPPUNIT_TEST(testSinewaveFlac); CPPUNIT_TEST(testZeroSizedPaddingFlac); + CPPUNIT_TEST(testFLACWithMPEGSyncBytes); // Ogg::Speex::File CPPUNIT_TEST(testEmptySpx); // Ogg::Opus::File @@ -326,6 +327,9 @@ public: void testZeroSizedPaddingFlac() { detectByContent("zero-sized-padding.flac"); } + void testFLACWithMPEGSyncBytes() { + detectByContent("mpeg-sync-flac.flac"); + } // -- Ogg::Speex::File -- void testEmptySpx() { detectByContent("empty.spx"); }