diff options
author | Yusuke Nakamura <muken.the.vfrmaniac@gmail.com> | 2011-05-12 05:28:27 +0900 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2011-05-12 15:52:25 +0200 |
commit | 5f0bb0baefd506d684adfa1ad4259c65973b455e (patch) | |
tree | 5e0d2037aef00e17bab91f996c1a3421e9a10d10 /libavformat/mov.c | |
parent | ced9556b6189de67dd740f5231c6f1807f3e3704 (diff) | |
download | ffmpeg-streaming-5f0bb0baefd506d684adfa1ad4259c65973b455e.zip ffmpeg-streaming-5f0bb0baefd506d684adfa1ad4259c65973b455e.tar.gz |
mov: Support edit list atom version 1.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 90f583f..cede1f7 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2163,13 +2163,13 @@ free_and_return: static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom) { MOVStreamContext *sc; - int i, edit_count; + int i, edit_count, version; if (c->fc->nb_streams < 1) return 0; sc = c->fc->streams[c->fc->nb_streams-1]->priv_data; - avio_r8(pb); /* version */ + version = avio_r8(pb); /* version */ avio_rb24(pb); /* flags */ edit_count = avio_rb32(pb); /* entries */ @@ -2177,9 +2177,15 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom) return -1; for(i=0; i<edit_count; i++){ - int time; - int duration = avio_rb32(pb); /* Track duration */ - time = avio_rb32(pb); /* Media time */ + int64_t time; + int64_t duration; + if (version == 1) { + duration = avio_rb64(pb); + time = avio_rb64(pb); + } else { + duration = avio_rb32(pb); /* segment duration */ + time = avio_rb32(pb); /* media time */ + } avio_rb32(pb); /* Media rate */ if (i == 0 && time >= -1) { sc->time_offset = time != -1 ? time : -duration; |