summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-05 17:38:25 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-05 17:46:40 +0100
commite2bf00ce4643ea3c09b146831dec485acedf6072 (patch)
tree104039d23df8a0df4ed617d09e76dd2e8b06bc97
parent1565a9a9e90cc2fe6295b51e4cb9240247d40a30 (diff)
avformat/mov: calculate rfps from the first 100 frames of the index
This reduces the amount of frames that need to be demuxed in av_find_stream_info() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mov.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 94bd32fd28..7c0c89767b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2159,6 +2159,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
av_dlog(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
"size %d, distance %d, keyframe %d\n", st->index, current_sample,
current_offset, current_dts, sample_size, distance, keyframe);
+ if (st->nb_index_entries < 100)
+ ff_rfps_add_frame(mov->fc, st, current_dts);
}
current_offset += sample_size;
@@ -3410,6 +3412,8 @@ static int mov_read_header(AVFormatContext *s)
}
}
+ ff_rfps_calculate(s);
+
return 0;
}