summaryrefslogtreecommitdiff
path: root/libavformat/demux.c
diff options
context:
space:
mode:
authorNicolas Gaullier <nicolas.gaullier@cji.paris>2021-09-10 11:34:09 +0200
committerJames Almer <jamrial@gmail.com>2021-09-23 10:35:09 -0300
commitdaf04868d8a20d25d5fc664e26137ddfabd4d40a (patch)
tree23167144953f8b394c821fbc6362aeb297e8beca /libavformat/demux.c
parentfad459b5a6461bf2ce2c232d5e251dd486bbdc0d (diff)
downloadffmpeg-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.c2
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) {