[FFmpeg-cvslog] mov: use tkhd enabled flag to set the default track
John Stebbins
git at videolan.org
Fri Aug 23 13:33:13 CEST 2013
ffmpeg | branch: master | John Stebbins <stebbins at jetheaddev.com> | Thu Aug 22 07:25:17 2013 -0700| [1f70a5ad284b33e8b3e2b40a5cb33055419781b7] | committer: Anton Khirnov
mov: use tkhd enabled flag to set the default track
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f70a5ad284b33e8b3e2b40a5cb33055419781b7
---
libavformat/isom.h | 5 +++++
libavformat/mov.c | 10 +++-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 932b1d0..94f1296 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -190,6 +190,11 @@ void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id);
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO 0x02000000
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES 0x01000000
+#define MOV_TKHD_FLAG_ENABLED 0x0001
+#define MOV_TKHD_FLAG_IN_MOVIE 0x0002
+#define MOV_TKHD_FLAG_IN_PREVIEW 0x0004
+#define MOV_TKHD_FLAG_IN_POSTER 0x0008
+
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom);
enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0c938cd..c036b21 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2125,6 +2125,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
AVStream *st;
MOVStreamContext *sc;
int version;
+ int flags;
if (c->fc->nb_streams < 1)
return 0;
@@ -2132,13 +2133,8 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
sc = st->priv_data;
version = avio_r8(pb);
- avio_rb24(pb); /* flags */
- /*
- MOV_TRACK_ENABLED 0x0001
- MOV_TRACK_IN_MOVIE 0x0002
- MOV_TRACK_IN_PREVIEW 0x0004
- MOV_TRACK_IN_POSTER 0x0008
- */
+ flags = avio_rb24(pb);
+ st->disposition |= (flags & MOV_TKHD_FLAG_ENABLED) ? AV_DISPOSITION_DEFAULT : 0;
if (version == 1) {
avio_rb64(pb);
More information about the ffmpeg-cvslog
mailing list