Skip to content

Commit

Permalink
MythPlayer: Use MythDisplay for refresh rate if we haven't yet created a
Browse files Browse the repository at this point in the history
videosync object

- which ensures we setup decoder based deinterlacers correctly - which
are initialised before the video output itself
  • Loading branch information
mark-kendall committed May 27, 2019
1 parent 8a1c32a commit 89c3695
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -2565,16 +2565,25 @@ void MythPlayer::PreProcessNormalFrame(void)

bool MythPlayer::CanSupportDoubleRate(void)
{
if (!videosync)
return false;
int refreshinterval = 1;
if (videosync)
{
refreshinterval = videosync->getRefreshInterval();
}
else
{
// used by the decoder before videosync is created
refreshinterval = MythDisplay::GetDisplayInfo(frame_interval).Rate();
}

// At this point we may not have the correct frame rate.
// Since interlaced is always at 25 or 30 fps, if the interval
// is less than 30000 (33fps) it must be representing one
// field and not one frame, so multiply by 2.
int realfi = frame_interval;
if (frame_interval < 30000)
realfi = frame_interval * 2;
return (realfi / 2.0 > videosync->getRefreshInterval() * 0.995);
return ((realfi / 2.0) > (refreshinterval * 0.995));
}

void MythPlayer::EnableFrameRateMonitor(bool enable)
Expand Down Expand Up @@ -2682,9 +2691,9 @@ void MythPlayer::VideoStart(void)
}
else if (videoOutput)
{
m_double_framerate = CanSupportDoubleRate();
videoOutput->SetDeinterlacing(true, m_double_framerate);
videosync = VideoSync::BestMethod(videoOutput, static_cast<uint>(rf_int));
m_double_framerate = CanSupportDoubleRate(); // needs videosync
videoOutput->SetDeinterlacing(true, m_double_framerate);
}

if (!videosync)
Expand Down

0 comments on commit 89c3695

Please sign in to comment.