diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-09-19 14:46:12 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-09-19 16:12:53 +0300 |
commit | fba35aa8c5cdedb3132b286874c5185c59af35a2 (patch) | |
tree | fa86a8fff40462b25b4f029a440bba7ed51fdd04 /source/blender/imbuf | |
parent | 1e09dd094b0187ef7b7b202154bc810dc1479034 (diff) |
Use FFmpeg's own `av_guess_frame_rate()` function instead of guessing ourselves
This was introduced in FFmpeg lavf 55.1.100 in 2013. For systems that are
still on LibAV or older FFmpeg there is a fallback implementation that
performs the same guess as we did before in `av_get_r_frame_rate_compat()`.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index da7dcc54343..5bfcca22fae 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -569,7 +569,7 @@ static int startffmpeg(struct anim *anim) return -1; } - frame_rate = av_get_r_frame_rate_compat(pFormatCtx, video_stream); + frame_rate = av_guess_frame_rate(pFormatCtx, video_stream, NULL); if (video_stream->nb_frames != 0) { anim->duration = video_stream->nb_frames; } @@ -1040,7 +1040,7 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position, IMB_Timecode_Typ v_st = anim->pFormatCtx->streams[anim->videoStream]; - frame_rate = av_q2d(av_get_r_frame_rate_compat(anim->pFormatCtx, v_st)); + frame_rate = av_q2d(av_guess_frame_rate(anim->pFormatCtx, v_st, NULL)); st_time = anim->pFormatCtx->start_time; pts_time_base = av_q2d(v_st->time_base); diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 66e0a681f8f..97a0cc85301 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -900,7 +900,7 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, stream_size = avio_size(context->iFormatCtx->pb); - context->frame_rate = av_q2d(av_get_r_frame_rate_compat(context->iFormatCtx, context->iStream)); + 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) { |