Commit 375d7ee8 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'df2aa222'

* commit 'df2aa222':
  mov: Clarify tkhd flag settings

Conflicts:
	libavformat/movenc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 4c915994 df2aa222
...@@ -1777,9 +1777,11 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov, ...@@ -1777,9 +1777,11 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
int64_t duration = av_rescale_rnd(track->track_duration, MOV_TIMESCALE, int64_t duration = av_rescale_rnd(track->track_duration, MOV_TIMESCALE,
track->timescale, AV_ROUND_UP); track->timescale, AV_ROUND_UP);
int version = duration < INT32_MAX ? 0 : 1; int version = duration < INT32_MAX ? 0 : 1;
int flags = MOV_TKHD_FLAG_IN_MOVIE;
int rotation = 0; int rotation = 0;
int group = 0; int group = 0;
if (st) { if (st) {
if (mov->per_stream_grouping) if (mov->per_stream_grouping)
group = st->index; group = st->index;
...@@ -1787,15 +1789,16 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov, ...@@ -1787,15 +1789,16 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
group = st->codec->codec_type; group = st->codec->codec_type;
} }
if (track->flags & MOV_TRACK_ENABLED)
flags |= MOV_TKHD_FLAG_ENABLED;
if (track->mode == MODE_ISM) if (track->mode == MODE_ISM)
version = 1; version = 1;
(version == 1) ? avio_wb32(pb, 104) : avio_wb32(pb, 92); /* size */ (version == 1) ? avio_wb32(pb, 104) : avio_wb32(pb, 92); /* size */
ffio_wfourcc(pb, "tkhd"); ffio_wfourcc(pb, "tkhd");
avio_w8(pb, version); avio_w8(pb, version);
avio_wb24(pb, (track->flags & MOV_TRACK_ENABLED) ? avio_wb24(pb, flags);
MOV_TKHD_FLAG_ENABLED | MOV_TKHD_FLAG_IN_MOVIE :
MOV_TKHD_FLAG_IN_MOVIE);
if (version == 1) { if (version == 1) {
avio_wb64(pb, track->time); avio_wb64(pb, track->time);
avio_wb64(pb, track->time); avio_wb64(pb, track->time);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment