aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalP <crystalp@kodi.tv>2024-03-02 13:28:51 -0500
committerGitHub <noreply@github.com>2024-03-02 13:28:51 -0500
commit7075efedfbf13f4f5bfa28e2fa57d7421ff5ab92 (patch)
tree919ee41d6264e6e8d7f1d071e1cec4355a346272
parent2937a12e856a14c50ed6410f530ea89a0a46264b (diff)
parent24aea0bc5d7c973cbb3c36ea5c7bb568050adb76 (diff)
Merge pull request #24785 from CrystalP/fix-interlacedfr
[VideoPlayer] Fix initial interlaced stream refresh rate switch
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.cpp7
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp3
2 files changed, 4 insertions, 6 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
index 07415753ea..22ff110501 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
@@ -3753,10 +3753,9 @@ bool CVideoPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset)
{
if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF)
{
- const double framerate =
- DVD_TIME_BASE /
- CDVDCodecUtils::NormalizeFrameduration(
- (double)DVD_TIME_BASE * ((hint.interlaced ? 2 : 1) * hint.fpsscale) / hint.fpsrate);
+ const double framerate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration(
+ (double)DVD_TIME_BASE * hint.fpsscale /
+ (hint.fpsrate * (hint.interlaced ? 2 : 1)));
RESOLUTION res = CResolutionUtils::ChooseBestResolution(static_cast<float>(framerate), hint.width, hint.height, !hint.stereo_mode.empty());
CServiceBroker::GetWinSystem()->GetGfxContext().SetVideoResolution(res, false);
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
index 52bc38d24c..0924703702 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
@@ -173,8 +173,7 @@ void CVideoPlayerVideo::OpenStream(CDVDStreamInfo& hint, std::unique_ptr<CDVDVid
if (hint.fpsrate && hint.fpsscale)
{
m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration(
- (double)DVD_TIME_BASE *
- ((hint.interlaced ? 2 : 1) * hint.fpsscale) / hint.fpsrate);
+ (double)DVD_TIME_BASE * hint.fpsscale / hint.fpsrate);
m_bFpsInvalid = false;
m_processInfo.SetVideoFps(static_cast<float>(m_fFrameRate));