aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalP <crystalp@kodi.tv>2024-03-01 08:18:26 -0500
committerCrystalP <crystalp@kodi.tv>2024-03-01 08:18:26 -0500
commit24aea0bc5d7c973cbb3c36ea5c7bb568050adb76 (patch)
tree85f74be5370cb6e45dc613be573333a864666a58
parent99e0546427d86e9d1427073f604abe7854777b08 (diff)
[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));