From 4e90305da73eb76cc97af21ddf22e6b9174b336c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Tue, 31 Dec 2024 13:33:42 +0100 Subject: [PATCH] VideoStream: fix detected FPS Ref: #397 --- src/core/FileCacheHandlers/videostreamsdata.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/FileCacheHandlers/videostreamsdata.cpp b/src/core/FileCacheHandlers/videostreamsdata.cpp index f2a976062..fab524416 100644 --- a/src/core/FileCacheHandlers/videostreamsdata.cpp +++ b/src/core/FileCacheHandlers/videostreamsdata.cpp @@ -105,8 +105,9 @@ void VideoStreamsData::open(const char * const path) vidCodecPars = iCodecPars; vidCodec = avcodec_find_decoder(vidCodecPars->codec_id); fVideoStream = fFormatContext->streams[fVideoStreamIndex]; - fTimeBaseDen = fVideoStream->r_frame_rate.den; //avg_frame_rate ?? - fTimeBaseNum = fVideoStream->r_frame_rate.num; //avg_frame_rate ?? + fTimeBaseDen = fVideoStream->avg_frame_rate.den; + fTimeBaseNum = fVideoStream->avg_frame_rate.num; + if (fTimeBaseDen == 0) { RuntimeThrow(QObject::tr("Invalid video frame rate denominator (0)")); }