[FFmpeg-cvslog] mov: Clarify tkhd flag settings

Luca Barbato git at videolan.org
Fri Jul 11 13:12:56 CEST 2014


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Fri Jul  4 16:53:31 2014 +0200| [df2aa22203afc9377832bdf800df5dbd3aa9687e] | committer: Luca Barbato

mov: Clarify tkhd flag settings

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df2aa22203afc9377832bdf800df5dbd3aa9687e
---

 libavformat/movenc.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b0c380e..f16e851 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1465,8 +1465,10 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
     int64_t duration = av_rescale_rnd(track->track_duration, MOV_TIMESCALE,
                                       track->timescale, AV_ROUND_UP);
     int version = duration < INT32_MAX ? 0 : 1;
+    int flags   = MOV_TKHD_FLAG_IN_MOVIE;
     int group   = 0;
 
+
     if (st) {
         if (mov->per_stream_grouping)
             group = st->index;
@@ -1474,15 +1476,16 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
             group = st->codec->codec_type;
     }
 
+    if (track->flags & MOV_TRACK_ENABLED)
+        flags |= MOV_TKHD_FLAG_ENABLED;
+
     if (track->mode == MODE_ISM)
         version = 1;
 
     (version == 1) ? avio_wb32(pb, 104) : avio_wb32(pb, 92); /* size */
     ffio_wfourcc(pb, "tkhd");
     avio_w8(pb, version);
-    avio_wb24(pb, (track->flags & MOV_TRACK_ENABLED) ?
-                  MOV_TKHD_FLAG_ENABLED | MOV_TKHD_FLAG_IN_MOVIE :
-                  MOV_TKHD_FLAG_IN_MOVIE);
+    avio_wb24(pb, flags);
     if (version == 1) {
         avio_wb64(pb, track->time);
         avio_wb64(pb, track->time);



More information about the ffmpeg-cvslog mailing list