summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-02-16 20:58:09 +0100
committerMartin Storsjö <martin@martin.st>2012-02-18 21:13:35 +0200
commit3eec23f3cd7b0d8ef0a545089f75b55390a8ddb9 (patch)
tree941441ce4ffb7fdb43f448c0e1586f1c7e762fc4 /libavformat/movenc.c
parent73328f24fae92eeed907a4908ca3147d874ff674 (diff)
mov: Use defines for trun flags
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 6c17e5ad16..22c918391c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2229,7 +2229,7 @@ static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry)
static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track)
{
int64_t pos = avio_tell(pb);
- uint32_t flags = 1; /* data-offset-present */
+ uint32_t flags = MOV_TRUN_DATA_OFFSET;
int i;
for (i = 0; i < track->entry; i++) {
@@ -2237,16 +2237,16 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track)
track->track_duration - track->cluster[i].dts + track->start_dts :
track->cluster[i + 1].dts - track->cluster[i].dts;
if (duration != track->default_duration)
- flags |= 0x100; /* sample-duration-present */
+ flags |= MOV_TRUN_SAMPLE_DURATION;
if (track->cluster[i].size != track->default_size)
- flags |= 0x200; /* sample-size-present */
+ flags |= MOV_TRUN_SAMPLE_SIZE;
if (i > 0 && get_sample_flags(track, &track->cluster[i]) != track->default_sample_flags)
- flags |= 0x400; /* sample-flags-present */
+ flags |= MOV_TRUN_SAMPLE_FLAGS;
}
- if (!(flags & 0x400))
- flags |= 0x4; /* first-sample-flags-present */
+ if (!(flags & MOV_TRUN_SAMPLE_FLAGS))
+ flags |= MOV_TRUN_FIRST_SAMPLE_FLAGS;
if (track->flags & MOV_TRACK_CTTS)
- flags |= 0x800; /* sample-composition-time-offsets-present */
+ flags |= MOV_TRUN_SAMPLE_CTS;
avio_wb32(pb, 0); /* size placeholder */
ffio_wfourcc(pb, "trun");
@@ -2256,20 +2256,20 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track)
avio_wb32(pb, track->entry); /* sample count */
track->moof_size_offset = avio_tell(pb);
avio_wb32(pb, 0); /* data offset */
- if (flags & 0x4) /* first sample flags */
+ if (flags & MOV_TRUN_FIRST_SAMPLE_FLAGS)
avio_wb32(pb, get_sample_flags(track, &track->cluster[0]));
for (i = 0; i < track->entry; i++) {
int64_t duration = i + 1 == track->entry ?
track->track_duration - track->cluster[i].dts + track->start_dts :
track->cluster[i + 1].dts - track->cluster[i].dts;
- if (flags & 0x100)
+ if (flags & MOV_TRUN_SAMPLE_DURATION)
avio_wb32(pb, duration);
- if (flags & 0x200)
+ if (flags & MOV_TRUN_SAMPLE_SIZE)
avio_wb32(pb, track->cluster[i].size);
- if (flags & 0x400)
+ if (flags & MOV_TRUN_SAMPLE_FLAGS)
avio_wb32(pb, get_sample_flags(track, &track->cluster[i]));
- if (flags & 0x800)
+ if (flags & MOV_TRUN_SAMPLE_CTS)
avio_wb32(pb, track->cluster[i].cts);
}