shithub: aacdec

Download patch

ref: 5ecb2ee2de967a861a3e0bfb2e2a3990fde08d53
parent: 3e1f2d409f2cbd7894e6ca91267b68987ef867c1
author: menno <menno>
date: Mon Jan 5 15:03:29 EST 2004

Fixed some tag writing of cover art

--- a/common/mp4v2/atom_meta.cpp
+++ b/common/mp4v2/atom_meta.cpp
@@ -100,6 +100,7 @@
     ExpectChildAtom("gnre", Optional, OnlyOne); /* genre (ID3v1 index + 1) */
     ExpectChildAtom("cpil", Optional, OnlyOne); /* compilation */
     ExpectChildAtom("tmpo", Optional, OnlyOne); /* BPM */
+    ExpectChildAtom("covr", Optional, OnlyOne); /* cover art */
     ExpectChildAtom("----", Optional, Many); /* ---- free form */
 }
 
@@ -185,6 +186,12 @@
 
 MP4TmpoAtom::MP4TmpoAtom()
     : MP4Atom("tmpo")
+{
+    ExpectChildAtom("data", Required, OnlyOne);
+}
+
+MP4CovrAtom::MP4CovrAtom()
+    : MP4Atom("covr")
 {
     ExpectChildAtom("data", Required, OnlyOne);
 }
--- a/common/mp4v2/atoms.h
+++ b/common/mp4v2/atoms.h
@@ -575,6 +575,11 @@
 	MP4TmpoAtom();
 };
 
+class MP4CovrAtom : public MP4Atom {
+public:
+	MP4CovrAtom();
+};
+
 class MP4CmtAtom : public MP4Atom {
 public:
 	MP4CmtAtom();
--- a/common/mp4v2/mp4atom.cpp
+++ b/common/mp4v2/mp4atom.cpp
@@ -75,6 +75,8 @@
 	pAtom = new MP4CprtAtom();
       } else if (ATOMID(type) == ATOMID("cpil")) { /* Apple iTunes */
 	pAtom = new MP4CpilAtom();
+      } else if (ATOMID(type) == ATOMID("covr")) { /* Apple iTunes */
+	pAtom = new MP4CovrAtom();
       }
       break;
     case 'd':
--- a/plugins/in_mp4/in_mp4.c
+++ b/plugins/in_mp4/in_mp4.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: in_mp4.c,v 1.49 2004/01/02 16:38:48 ca5e Exp $
+** $Id: in_mp4.c,v 1.50 2004/01/05 20:03:29 menno Exp $
 **/
 
 //#define DEBUG_OUTPUT
@@ -277,6 +277,8 @@
                 } else {
                     tag_add_field(tags, pName, val, valueSize);
                 }
+            } else if (memcmp(pName, "covr", 4) == 0) {
+                tag_add_field(tags, "cover", val, valueSize);
             } else if (memcmp(pName, "gnre", 4) == 0) {
                 char *t=0;
                 if (MP4GetMetadataGenre(file, &t))
@@ -401,6 +403,10 @@
     else if (!stricmp(item, "tool"))
     {
         if (MP4SetMetadataTool(file, val)) return 1;
+    }
+    else if (!stricmp(item, "cover"))
+    {
+        if (MP4SetMetadataCoverArt(file, val, v_len)) return 1;
     }
     else
     {