From 10191e4ff4e8053257bfb6244b7eda518f2fbed6 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 20 Sep 2015 10:40:35 +0200 Subject: [PATCH] VideoPlayer: limit sleep time for render to 500ms --- xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp index c50148a3bc7e8..9b750c267c0c2 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp @@ -919,7 +919,7 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) return EOS_ABORT; } - int result = 0; + int result = 0; //correct any pattern in the timestamps if (picture.format != RENDER_FMT_BYPASS) @@ -966,13 +966,17 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) iFrameSleep = 0; } - if( m_started == false ) + if (m_started == false) iSleepTime = 0.0; - else if( m_stalled || m_pClock->GetMaster() == MASTER_CLOCK_VIDEO) + else if (m_stalled || m_pClock->GetMaster() == MASTER_CLOCK_VIDEO) iSleepTime = iFrameSleep; else iSleepTime = iClockSleep; + // limit sleep time to 500ms + if (iSleepTime > DVD_MSEC_TO_TIME(500)) + iSleepTime = DVD_MSEC_TO_TIME(500); + if (m_speed < 0) { double sleepTime, renderPts;