Skip to content

Commit

Permalink
VideoPlayer: limit sleep time for render to 500ms
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Sep 20, 2015
1 parent 910d642 commit 10191e4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 10191e4

Please sign in to comment.