shithub: aacenc

Download patch

ref: 98c5d013c1be8035a9e493eb94b0919d40618b94
parent: 5321541cd8b29ae32690d600a01fea8fba8983eb
author: knik <knik@users.sourceforge.net>
date: Mon Jul 17 18:56:05 EDT 2017

enabled --track and --disc tags

--- a/frontend/main.c
+++ b/frontend/main.c
@@ -1112,11 +1112,8 @@
         SETTAG(composer);
         SETTAG(title);
         SETTAG(album);
-#if 0
-        // fixme: those aren't right yet
         SETTAG(trackno);
         SETTAG(discno);
-#endif
         SETTAG(compilation);
         SETTAG(year);
         SETTAG(genre);
--- a/frontend/mp4atom.c
+++ b/frontend/mp4atom.c
@@ -526,9 +526,9 @@
     return size;
 }
 
-static int tagu32(char *tagname, uint32_t n)
+static int tagu32(char *tagname, int n /*number of stored fields*/)
 {
-    int numsize = 4;
+    int numsize = n * 4;
     int size = 0;
     int datasize = numsize + 16;
 
@@ -538,7 +538,6 @@
     size += dataout("data", 4);
     size += u32out(0);
     size += u32out(0);
-    size += u32out(n);
 
     return size;
 }
@@ -579,11 +578,20 @@
     if (mp4config.tag.album)
         size += tagtxt("\xa9" "alb", mp4config.tag.album);
     if (mp4config.tag.compilation)
-        size += tagu32("cpil", mp4config.tag.compilation);
+    {
+        size += tagu32("cpil", 1);
+        size += u32out(mp4config.tag.compilation);
+    }
     if (mp4config.tag.trackno)
-        size += tagu32("trkn", mp4config.tag.trackno);
+    {
+        size += tagu32("trkn", 1);
+        size += u32out(mp4config.tag.trackno);
+    }
     if (mp4config.tag.discno)
-        size += tagu32("disk", mp4config.tag.discno);
+    {
+        size += tagu32("disk", 1);
+        size += u32out(mp4config.tag.discno);
+    }
     if (mp4config.tag.year)
         size += tagtxt("\xa9" "day", mp4config.tag.year);
 #if 0