On Tue, Aug 20, 2013 at 08:00:06AM -0700, John Stebbins wrote:
> From ddfd353d4f7a287bdc9c41c21be435b53322ca7e Mon Sep 17 00:00:00 2001
> From: John Stebbins <[email protected]>
> Date: Tue, 20 Aug 2013 07:54:11 -0700
> Subject: [PATCH 6/7] movenc: Make tkhd "enabled" flag QuickTime compatible
> 
> QuickTime will play multiple audio tracks concurrently if this flag is
> set for multiple audio tracks.  And if no subtitle track has this flag
> set QuickTime will show no subtitles in the subtitle menu.

set,

> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1380,7 +1380,15 @@ static int mov_write_tkhd_tag(AVIOContext *pb, 
> MOVTrack *track, AVStream *st)
>      (version == 1) ? avio_wb32(pb, 104) : avio_wb32(pb, 92); /* size */
>      ffio_wfourcc(pb, "tkhd");
>      avio_w8(pb, version);
> -    avio_wb24(pb, 0xf); /* flags (track enabled) */
> +    avio_wb24(pb, (track->flags & MOV_TRACK_ENABLED) ?
> +                MOV_TKHD_FLAG_ENABLED | MOV_TKHD_FLAG_IN_MOVIE :
> +                MOV_TKHD_FLAG_IN_MOVIE);

Indentation is off.

> @@ -3008,6 +3016,56 @@ static void mov_create_chapter_track(AVFormatContext 
> *s, int tracknum)
>  
> +// st->disposition controls the "enabled" flag in the tkhd tag.
> +// QuickTime will not play a track if it is not enabled.  So make sure
> +// that one track of each type (audio, video, subtitle) is enabled.
> +//
> +// Subtitles are special.  For audio and video, setting "enabled" also
> +// makes the track "default" (i.e. it is rendered when played). For
> +// subtitles, an "enabled" subtitle is not rendered by default, but
> +// if no subtitle is enabled, the subtitle menu in QuickTime will be
> +// empty!
> +static void enable_tracks(AVFormatContext *s)

nit: /* */

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to