aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-16 01:28:08 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-16 01:30:47 +0100
commit38e641a060e0c00930851a8053ca96250b3ecccc (patch)
tree7066d7799cc30c6c972289bb88fb99b6fe290d3f
parentf9e76d66e93a888e79fbddc2d6bb7b778c856d20 (diff)
downloadffmpeg-38e641a060e0c00930851a8053ca96250b3ecccc.tar.gz
avformat/mov: Bypass av_add_index_entry()
The new mov code uses a temporally non sorted index since 4abfa387b8234736f6e0e541951e3d5eb60eb843 and can thus no longer be filled with av_add_index_entry() which expects the index to be sorted. Reverting 4abfa387b8234736f6e0e541951e3d5eb60eb843 and this commit would be a alternative fix as would be various other options. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mov.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1a5a518e21..6d2262a2c3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3153,8 +3153,9 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES));
if (keyframe)
distance = 0;
- av_add_index_entry(st, offset, cts, sample_size, distance,
+ av_add_index_entry(st, offset, INT64_MAX/2, sample_size, distance,
keyframe ? AVINDEX_KEYFRAME : 0);
+ st->index_entries[st->nb_index_entries - 1].timestamp = cts;
av_dlog(c->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", cts %"PRId64", "
"size %d, distance %d, keyframe %d\n", st->index, sc->sample_count+i,
offset, cts, sample_size, distance, keyframe);