Skip to content

Commit d4bbe75

Browse files
author
Mark Kendall
committed
VideoSync: Update the refresh interval after a video stream change.
An input change, as seen in live tv, may change the refresh rate which then requires an update to the rate stored in the VideoSync object. If not, under certain circumstances the deinterlacer selection will fail (and probably a range of other, more subtle issues). Ref #10173 Ref #8336
1 parent 931369b commit d4bbe75

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

mythtv/libs/libmythtv/mythplayer.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,20 @@ void MythPlayer::ReinitVideo(void)
619619
return;
620620
}
621621

622+
// the display refresh rate may have been changed by VideoOutput
623+
if (videosync)
624+
{
625+
int ri = MythDisplay::GetDisplayInfo(frame_interval).Rate();
626+
if (ri != videosync->getRefreshInterval())
627+
{
628+
LOG(VB_PLAYBACK, LOG_INFO, LOC +
629+
QString("Refresh rate has changed from %1 to %2")
630+
.arg(videosync->getRefreshInterval())
631+
.arg(ri));
632+
videosync->setRefreshInterval(ri);
633+
}
634+
}
635+
622636
if (osd)
623637
osd->SetPainter(videoOutput->GetOSDPainter());
624638
ReinitOSD();

mythtv/libs/libmythtv/vsync.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class VideoSync
7676

7777
/// \brief Returns the (minimum) refresh interval of the output device.
7878
int getRefreshInterval(void) const { return m_refresh_interval; }
79+
/// \brief Sets the refresh interval of the output device.
80+
void setRefreshInterval(int ri) { m_refresh_interval = ri; }
7981

8082
virtual void setFrameInterval(int fi) { m_frame_interval = fi; };
8183

0 commit comments

Comments
 (0)