]> granicus.if.org Git - handbrake/commitdiff
Only associate audio tracks with an alternate group if there's more than one audio...
authorjbrjake <jb.rubin@gmail.com>
Sat, 11 Oct 2008 19:19:27 +0000 (19:19 +0000)
committerjbrjake <jb.rubin@gmail.com>
Sat, 11 Oct 2008 19:19:27 +0000 (19:19 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1828 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/muxmp4.c

index 807bc24cded061ac8c23130a835c26708225ffe6..d36da397d5f29f8084f45068e418e96cd9b33ce9 100644 (file)
@@ -349,7 +349,10 @@ static int MP4Init( hb_mux_object_t * m )
             reserved2[9] = (u_int8_t)HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->config.out.mixdown);
             MP4SetTrackBytesProperty(m->file, mux_data->track, "mdia.minf.stbl.stsd.mp4a.reserved2", reserved2, sizeof(reserved2));
 
+            /* If we ever upgrade mpeg4ip, the line above should be replaced with the line below.*/
+            // MP4SetTrackIntegerProperty(m->file, mux_data->track, "mdia.minf.stbl.stsd.mp4a.channels", (u_int16_t)HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->amixdown));
         }
+
         /* Set the language for this track */
         /* The language is stored as 5-bit text - 0x60 */
         language_code = audio->config.lang.iso639_2[0] - 0x60;   language_code <<= 5;
@@ -357,12 +360,11 @@ static int MP4Init( hb_mux_object_t * m )
         language_code |= audio->config.lang.iso639_2[2] - 0x60;
         MP4SetTrackIntegerProperty(m->file, mux_data->track, "mdia.mdhd.language", language_code);
 
-
-        /* Set the audio track alternate group */
-        MP4SetTrackIntegerProperty(m->file, mux_data->track, "tkhd.alternate_group", 1);
-
-        /* If we ever upgrade mpeg4ip, the line above should be replaced with the line below.*/
-//        MP4SetTrackIntegerProperty(m->file, mux_data->track, "mdia.minf.stbl.stsd.mp4a.channels",  (u_int16_t)HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->amixdown));
+        if( hb_list_count( title->list_audio ) > 1 )
+        {
+            /* Set the audio track alternate group */
+            MP4SetTrackIntegerProperty(m->file, mux_data->track, "tkhd.alternate_group", 1);
+        }
 
         if (i == 0) {
             /* Enable the first audio track */