diff mbox series

[FFmpeg-devel,2/3] avformat/utils: Use r_frame_rate in compute_frame_duration if codec_framerate is unknown

Message ID 20210910093410.47858-3-nicolas.gaullier@cji.paris
State New
Headers show
Series Detect field_order when probing MP4/H264 | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Nicolas Gaullier Sept. 10, 2021, 9:34 a.m. UTC
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index b56190d2da..6d4a9bc3d6 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -884,7 +884,7 @@  static void compute_frame_duration(AVFormatContext *s, int *pnum, int *pden,
     *pden = 0;
     switch (st->codecpar->codec_type) {
     case AVMEDIA_TYPE_VIDEO:
-        if (st->r_frame_rate.num && !pc) {
+        if (st->r_frame_rate.num && (!pc || !codec_framerate.num)) {
             *pnum = st->r_frame_rate.den;
             *pden = st->r_frame_rate.num;
         } else if (st->time_base.num * 1000LL > st->time_base.den) {