]> granicus.if.org Git - taglib/commitdiff
Handle iTunes ID3v2.3 hacks
authorDuke Yin <dukeyin@outlook.com>
Wed, 16 Oct 2013 22:48:49 +0000 (18:48 -0400)
committerDuke Yin <dukeyin@outlook.com>
Wed, 16 Oct 2013 22:48:49 +0000 (18:48 -0400)
iTunes writes the 2.4 frames TSOA, TSOT, TSOP to 2.3 files.  (It
additionally defines TSO2 and TSOC for both 2.3 and 2.4.)  TagLib should
not delete these frames.

taglib/mpeg/id3v2/id3v2tag.cpp

index 57637a36e9b8d0887f07bd10740dfb28d8f4ac7a..765086c888b065b6d5e396df5a2f9f4be8ab1672 100644 (file)
@@ -461,10 +461,18 @@ ByteVector ID3v2::Tag::render() const
 
 void ID3v2::Tag::downgradeFrames(FrameList *frames, FrameList *newFrames) const
 {
+#ifdef NO_ITUNES_HACKS 
   const char *unsupportedFrames[] = {
     "ASPI", "EQU2", "RVA2", "SEEK", "SIGN", "TDRL", "TDTG",
     "TMOO", "TPRO", "TSOA", "TSOT", "TSST", "TSOP", 0
   };
+#else
+  // iTunes writes and reads TSOA, TSOT, TSOP to ID3v2.3.
+  const char *unsupportedFrames[] = {
+    "ASPI", "EQU2", "RVA2", "SEEK", "SIGN", "TDRL", "TDTG",
+    "TMOO", "TPRO", "TSST", 0
+  };
+#endif
   ID3v2::TextIdentificationFrame *frameTDOR = 0;
   ID3v2::TextIdentificationFrame *frameTDRC = 0;
   ID3v2::TextIdentificationFrame *frameTIPL = 0;