Skip to content

Commit e2bf00c

Browse files
committed
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 <[email protected]>
1 parent 1565a9a commit e2bf00c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libavformat/mov.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,6 +2159,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
21592159
av_dlog(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
21602160
"size %d, distance %d, keyframe %d\n", st->index, current_sample,
21612161
current_offset, current_dts, sample_size, distance, keyframe);
2162+
if (st->nb_index_entries < 100)
2163+
ff_rfps_add_frame(mov->fc, st, current_dts);
21622164
}
21632165

21642166
current_offset += sample_size;
@@ -3410,6 +3412,8 @@ static int mov_read_header(AVFormatContext *s)
34103412
}
34113413
}
34123414

3415+
ff_rfps_calculate(s);
3416+
34133417
return 0;
34143418
}
34153419

0 commit comments

Comments
 (0)