Fix T100771: Incorrect strip length when timecodes are used

Some files have 2 different framerates stored in metadata. Use function
`av_guess_frame_rate` to get media FPS, because it provides more
consistent / correct values across multiple files.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15839
This commit is contained in:
Richard Antalik 2022-09-13 20:29:12 +02:00 committed by Philipp Oeser
parent 42937493d8
commit 440c29f65b
Notes: blender-bot 2023-02-14 05:41:57 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #100771, Incorrect strip length when timecodes are used
1 changed files with 1 additions and 1 deletions

View File

@ -1012,7 +1012,7 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context,
stream_size = avio_size(context->iFormatCtx->pb);
context->frame_rate = av_q2d(context->iStream->r_frame_rate);
context->frame_rate = av_q2d(av_guess_frame_rate(context->iFormatCtx, context->iStream, NULL));
context->pts_time_base = av_q2d(context->iStream->time_base);
while (av_read_frame(context->iFormatCtx, next_packet) >= 0) {