aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-02-16 20:48:30 +0100
committerMartin Storsjö <martin@martin.st>2012-02-18 21:13:33 +0200
commit73328f24fae92eeed907a4908ca3147d874ff674 (patch)
treef2e47ce2e3365f9c9cb0ed9d8e7dbe25142040cb /libavformat/mov.c
parent6d702dc072ffc255cd0f709132e55661698313e7 (diff)
downloadffmpeg-73328f24fae92eeed907a4908ca3147d874ff674.tar.gz
mov: Use defines for tfhd flags
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 690cd1ed46..74b2f2abf1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2167,14 +2167,16 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return AVERROR_INVALIDDATA;
}
- if (flags & 0x01) frag->base_data_offset = avio_rb64(pb);
- else frag->base_data_offset = frag->moof_offset;
- if (flags & 0x02) frag->stsd_id = avio_rb32(pb);
- else frag->stsd_id = trex->stsd_id;
-
- frag->duration = flags & 0x08 ? avio_rb32(pb) : trex->duration;
- frag->size = flags & 0x10 ? avio_rb32(pb) : trex->size;
- frag->flags = flags & 0x20 ? avio_rb32(pb) : trex->flags;
+ frag->base_data_offset = flags & MOV_TFHD_BASE_DATA_OFFSET ?
+ avio_rb64(pb) : frag->moof_offset;
+ frag->stsd_id = flags & MOV_TFHD_STSD_ID ? avio_rb32(pb) : trex->stsd_id;
+
+ frag->duration = flags & MOV_TFHD_DEFAULT_DURATION ?
+ avio_rb32(pb) : trex->duration;
+ frag->size = flags & MOV_TFHD_DEFAULT_SIZE ?
+ avio_rb32(pb) : trex->size;
+ frag->flags = flags & MOV_TFHD_DEFAULT_FLAGS ?
+ avio_rb32(pb) : trex->flags;
av_dlog(c->fc, "frag flags 0x%x\n", frag->flags);
return 0;
}