diff options
author | Nicolas Gaullier <nicolas.gaullier@cji.paris> | 2021-09-10 11:34:09 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-09-23 10:35:09 -0300 |
commit | daf04868d8a20d25d5fc664e26137ddfabd4d40a (patch) | |
tree | 23167144953f8b394c821fbc6362aeb297e8beca /libavformat/demux.c | |
parent | fad459b5a6461bf2ce2c232d5e251dd486bbdc0d (diff) | |
download | ffmpeg-daf04868d8a20d25d5fc664e26137ddfabd4d40a.tar.gz |
avformat/demux: Use r_frame_rate in compute_frame_duration if codec_framerate is unknown
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/demux.c')
-rw-r--r-- | libavformat/demux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/demux.c b/libavformat/demux.c index d7393d5b46..6a4b687bf1 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -653,7 +653,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) { |