From cfcb7c041d8b81a429eddcd77e03dd5452f58bde Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 2 Jul 2022 04:20:01 -0700 Subject: [PATCH] [TagLib] Disable MP4 tag reader, as it can crash This MP4 tag reader is buggy. Disable it in favor of FFmpeg decoder's metadata reader. Signed-off-by: Christopher Snowhill --- .../TagLib/TagLib.xcodeproj/project.pbxproj | 56 ------------------- .../TagLib/taglib/taglib/audioproperties.cpp | 2 - Frameworks/TagLib/taglib/taglib/fileref.cpp | 6 -- .../TagLib/taglib/taglib/toolkit/tfile.cpp | 6 -- Plugins/TagLib/TagLibMetadataReader.m | 19 +------ 5 files changed, 1 insertion(+), 88 deletions(-) diff --git a/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj b/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj index fff029000..cbe142526 100644 --- a/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj +++ b/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj @@ -41,18 +41,6 @@ 32AE5A7B14E70ED600420CA0 /* flacproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59C514E70ED600420CA0 /* flacproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; 32AE5A7C14E70ED600420CA0 /* flacunknownmetadatablock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59C614E70ED600420CA0 /* flacunknownmetadatablock.cpp */; }; 32AE5A7D14E70ED600420CA0 /* flacunknownmetadatablock.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59C714E70ED600420CA0 /* flacunknownmetadatablock.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32AE5A7E14E70ED600420CA0 /* mp4atom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59C914E70ED600420CA0 /* mp4atom.cpp */; }; - 32AE5A7F14E70ED600420CA0 /* mp4atom.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59CA14E70ED600420CA0 /* mp4atom.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32AE5A8014E70ED600420CA0 /* mp4coverart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59CB14E70ED600420CA0 /* mp4coverart.cpp */; }; - 32AE5A8114E70ED600420CA0 /* mp4coverart.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59CC14E70ED600420CA0 /* mp4coverart.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32AE5A8214E70ED600420CA0 /* mp4file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59CD14E70ED600420CA0 /* mp4file.cpp */; }; - 32AE5A8314E70ED600420CA0 /* mp4file.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59CE14E70ED600420CA0 /* mp4file.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32AE5A8414E70ED600420CA0 /* mp4item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59CF14E70ED600420CA0 /* mp4item.cpp */; }; - 32AE5A8514E70ED600420CA0 /* mp4item.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59D014E70ED600420CA0 /* mp4item.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32AE5A8614E70ED600420CA0 /* mp4properties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59D114E70ED600420CA0 /* mp4properties.cpp */; }; - 32AE5A8714E70ED600420CA0 /* mp4properties.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59D214E70ED600420CA0 /* mp4properties.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32AE5A8814E70ED600420CA0 /* mp4tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59D314E70ED600420CA0 /* mp4tag.cpp */; }; - 32AE5A8914E70ED600420CA0 /* mp4tag.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59D414E70ED600420CA0 /* mp4tag.h */; settings = {ATTRIBUTES = (Public, ); }; }; 32AE5A8A14E70ED600420CA0 /* mpcfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59D614E70ED600420CA0 /* mpcfile.cpp */; }; 32AE5A8B14E70ED600420CA0 /* mpcfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59D714E70ED600420CA0 /* mpcfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; 32AE5A8C14E70ED600420CA0 /* mpcproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59D814E70ED600420CA0 /* mpcproperties.cpp */; }; @@ -236,18 +224,6 @@ 32AE59C514E70ED600420CA0 /* flacproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flacproperties.h; sourceTree = ""; }; 32AE59C614E70ED600420CA0 /* flacunknownmetadatablock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flacunknownmetadatablock.cpp; sourceTree = ""; }; 32AE59C714E70ED600420CA0 /* flacunknownmetadatablock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flacunknownmetadatablock.h; sourceTree = ""; }; - 32AE59C914E70ED600420CA0 /* mp4atom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4atom.cpp; sourceTree = ""; }; - 32AE59CA14E70ED600420CA0 /* mp4atom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4atom.h; sourceTree = ""; }; - 32AE59CB14E70ED600420CA0 /* mp4coverart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4coverart.cpp; sourceTree = ""; }; - 32AE59CC14E70ED600420CA0 /* mp4coverart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4coverart.h; sourceTree = ""; }; - 32AE59CD14E70ED600420CA0 /* mp4file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4file.cpp; sourceTree = ""; }; - 32AE59CE14E70ED600420CA0 /* mp4file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4file.h; sourceTree = ""; }; - 32AE59CF14E70ED600420CA0 /* mp4item.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4item.cpp; sourceTree = ""; }; - 32AE59D014E70ED600420CA0 /* mp4item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4item.h; sourceTree = ""; }; - 32AE59D114E70ED600420CA0 /* mp4properties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4properties.cpp; sourceTree = ""; }; - 32AE59D214E70ED600420CA0 /* mp4properties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4properties.h; sourceTree = ""; }; - 32AE59D314E70ED600420CA0 /* mp4tag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4tag.cpp; sourceTree = ""; }; - 32AE59D414E70ED600420CA0 /* mp4tag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4tag.h; sourceTree = ""; }; 32AE59D614E70ED600420CA0 /* mpcfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpcfile.cpp; sourceTree = ""; }; 32AE59D714E70ED600420CA0 /* mpcfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpcfile.h; sourceTree = ""; }; 32AE59D814E70ED600420CA0 /* mpcproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpcproperties.cpp; sourceTree = ""; }; @@ -569,7 +545,6 @@ 32AE59BB14E70ED600420CA0 /* fileref.cpp */, 32AE59BC14E70ED600420CA0 /* fileref.h */, 32AE59BD14E70ED600420CA0 /* flac */, - 32AE59C814E70ED600420CA0 /* mp4 */, 32AE59D514E70ED600420CA0 /* mpc */, 32AE59DA14E70ED600420CA0 /* mpeg */, 32AE5A1214E70ED600420CA0 /* ogg */, @@ -641,25 +616,6 @@ path = flac; sourceTree = ""; }; - 32AE59C814E70ED600420CA0 /* mp4 */ = { - isa = PBXGroup; - children = ( - 32AE59C914E70ED600420CA0 /* mp4atom.cpp */, - 32AE59CA14E70ED600420CA0 /* mp4atom.h */, - 32AE59CB14E70ED600420CA0 /* mp4coverart.cpp */, - 32AE59CC14E70ED600420CA0 /* mp4coverart.h */, - 32AE59CD14E70ED600420CA0 /* mp4file.cpp */, - 32AE59CE14E70ED600420CA0 /* mp4file.h */, - 32AE59CF14E70ED600420CA0 /* mp4item.cpp */, - 32AE59D014E70ED600420CA0 /* mp4item.h */, - 32AE59D114E70ED600420CA0 /* mp4properties.cpp */, - 32AE59D214E70ED600420CA0 /* mp4properties.h */, - 32AE59D314E70ED600420CA0 /* mp4tag.cpp */, - 32AE59D414E70ED600420CA0 /* mp4tag.h */, - ); - path = mp4; - sourceTree = ""; - }; 32AE59D514E70ED600420CA0 /* mpc */ = { isa = PBXGroup; children = ( @@ -1113,12 +1069,6 @@ 32AE5A7914E70ED600420CA0 /* flacpicture.h in Headers */, 32AE5A7B14E70ED600420CA0 /* flacproperties.h in Headers */, 32AE5A7D14E70ED600420CA0 /* flacunknownmetadatablock.h in Headers */, - 32AE5A7F14E70ED600420CA0 /* mp4atom.h in Headers */, - 32AE5A8114E70ED600420CA0 /* mp4coverart.h in Headers */, - 32AE5A8314E70ED600420CA0 /* mp4file.h in Headers */, - 32AE5A8514E70ED600420CA0 /* mp4item.h in Headers */, - 32AE5A8714E70ED600420CA0 /* mp4properties.h in Headers */, - 32AE5A8914E70ED600420CA0 /* mp4tag.h in Headers */, 32AE5A8B14E70ED600420CA0 /* mpcfile.h in Headers */, 32AE5A8D14E70ED600420CA0 /* mpcproperties.h in Headers */, 32AE5A8F14E70ED600420CA0 /* id3v1genres.h in Headers */, @@ -1277,12 +1227,6 @@ 32AE5A7A14E70ED600420CA0 /* flacproperties.cpp in Sources */, EDE863C625CF6D710086EFD3 /* ownershipframe.cpp in Sources */, 32AE5A7C14E70ED600420CA0 /* flacunknownmetadatablock.cpp in Sources */, - 32AE5A7E14E70ED600420CA0 /* mp4atom.cpp in Sources */, - 32AE5A8014E70ED600420CA0 /* mp4coverart.cpp in Sources */, - 32AE5A8214E70ED600420CA0 /* mp4file.cpp in Sources */, - 32AE5A8414E70ED600420CA0 /* mp4item.cpp in Sources */, - 32AE5A8614E70ED600420CA0 /* mp4properties.cpp in Sources */, - 32AE5A8814E70ED600420CA0 /* mp4tag.cpp in Sources */, 32AE5A8A14E70ED600420CA0 /* mpcfile.cpp in Sources */, 32AE5A8C14E70ED600420CA0 /* mpcproperties.cpp in Sources */, 32AE5A8E14E70ED600420CA0 /* id3v1genres.cpp in Sources */, diff --git a/Frameworks/TagLib/taglib/taglib/audioproperties.cpp b/Frameworks/TagLib/taglib/taglib/audioproperties.cpp index 30e66251e..7f5b1d95d 100644 --- a/Frameworks/TagLib/taglib/taglib/audioproperties.cpp +++ b/Frameworks/TagLib/taglib/taglib/audioproperties.cpp @@ -53,8 +53,6 @@ using namespace TagLib; return dynamic_cast(this)->function_name(); \ else if(dynamic_cast(this)) \ return dynamic_cast(this)->function_name(); \ - else if(dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ else if(dynamic_cast(this)) \ return dynamic_cast(this)->function_name(); \ else if(dynamic_cast(this)) \ diff --git a/Frameworks/TagLib/taglib/taglib/fileref.cpp b/Frameworks/TagLib/taglib/taglib/fileref.cpp index 8332f1bdf..360d5d5f8 100644 --- a/Frameworks/TagLib/taglib/taglib/fileref.cpp +++ b/Frameworks/TagLib/taglib/taglib/fileref.cpp @@ -123,8 +123,6 @@ namespace return new Ogg::Opus::File(stream, readAudioProperties, audioPropertiesStyle); if(ext == "TTA") return new TrueAudio::File(stream, readAudioProperties, audioPropertiesStyle); - if(ext == "M4A" || ext == "M4R" || ext == "M4B" || ext == "M4P" || ext == "MP4" || ext == "3G2" || ext == "M4V") - return new MP4::File(stream, readAudioProperties, audioPropertiesStyle); if(ext == "WMA" || ext == "ASF") return new ASF::File(stream, readAudioProperties, audioPropertiesStyle); if(ext == "AIF" || ext == "AIFF" || ext == "AFC" || ext == "AIFC") @@ -173,8 +171,6 @@ namespace file = new Ogg::Opus::File(stream, readAudioProperties, audioPropertiesStyle); else if(TrueAudio::File::isSupported(stream)) file = new TrueAudio::File(stream, readAudioProperties, audioPropertiesStyle); - else if(MP4::File::isSupported(stream)) - file = new MP4::File(stream, readAudioProperties, audioPropertiesStyle); else if(ASF::File::isSupported(stream)) file = new ASF::File(stream, readAudioProperties, audioPropertiesStyle); else if(RIFF::AIFF::File::isSupported(stream)) @@ -247,8 +243,6 @@ namespace return new Ogg::Opus::File(fileName, readAudioProperties, audioPropertiesStyle); if(ext == "TTA") return new TrueAudio::File(fileName, readAudioProperties, audioPropertiesStyle); - if(ext == "M4A" || ext == "M4R" || ext == "M4B" || ext == "M4P" || ext == "MP4" || ext == "3G2" || ext == "M4V") - return new MP4::File(fileName, readAudioProperties, audioPropertiesStyle); if(ext == "WMA" || ext == "ASF") return new ASF::File(fileName, readAudioProperties, audioPropertiesStyle); if(ext == "AIF" || ext == "AIFF" || ext == "AFC" || ext == "AIFC") diff --git a/Frameworks/TagLib/taglib/taglib/toolkit/tfile.cpp b/Frameworks/TagLib/taglib/taglib/toolkit/tfile.cpp index 90eb040ce..6754a8884 100644 --- a/Frameworks/TagLib/taglib/taglib/toolkit/tfile.cpp +++ b/Frameworks/TagLib/taglib/taglib/toolkit/tfile.cpp @@ -144,8 +144,6 @@ PropertyMap File::properties() const return dynamic_cast(this)->properties(); if(dynamic_cast(this)) return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); if(dynamic_cast(this)) return dynamic_cast(this)->properties(); if(dynamic_cast(this)) @@ -175,8 +173,6 @@ void File::removeUnsupportedProperties(const StringList &properties) dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) @@ -219,8 +215,6 @@ PropertyMap File::setProperties(const PropertyMap &properties) return dynamic_cast(this)->setProperties(properties); else if(dynamic_cast(this)) return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); else if(dynamic_cast(this)) return dynamic_cast(this)->setProperties(properties); else if(dynamic_cast(this)) diff --git a/Plugins/TagLib/TagLibMetadataReader.m b/Plugins/TagLib/TagLibMetadataReader.m index d7647e373..3ca83b1d3 100644 --- a/Plugins/TagLib/TagLibMetadataReader.m +++ b/Plugins/TagLib/TagLibMetadataReader.m @@ -10,7 +10,6 @@ #import #import #import -#import #import #import #import @@ -162,22 +161,6 @@ } } - // D-D-D-DOUBLE HACK! - TagLib::MP4::File *m4f = dynamic_cast(f.file()); - if(m4f) { - TagLib::MP4::Tag *tag = m4f->tag(); - if(tag) { - auto covr = tag->item("covr"); - if(covr.isValid()) { - auto coverArtList = covr.toCoverArtList(); - if(!coverArtList.isEmpty()) { - TagLib::MP4::CoverArt coverArt = coverArtList.front(); - image = [NSData dataWithBytes:coverArt.data().data() length:coverArt.data().size()]; - } - } - } - } - TagLib::Ogg::Vorbis::File *vorbis = dynamic_cast(f.file()); if(vorbis) { TagLib::Ogg::XiphComment *tag = vorbis->tag(); @@ -257,7 +240,7 @@ + (NSArray *)fileTypes { // May be a way to get a list of supported formats - return @[@"ape", @"asf", @"wma", @"ogg", @"opus", @"mpc", @"flac", @"m4a", @"mp3", @"tak", @"ac3", @"apl", @"dts", @"dtshd", @"tta", @"wav", @"aif", @"aiff", @"wv", @"wvp"]; + return @[@"ape", @"asf", @"wma", @"ogg", @"opus", @"mpc", @"flac", @"mp3", @"tak", @"ac3", @"apl", @"dts", @"dtshd", @"tta", @"wav", @"aif", @"aiff", @"wv", @"wvp"]; } + (NSArray *)mimeTypes {