Skip to content

Commit

Permalink
VideoPlayer: set clock to video pts when seeking while player is paused
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Jul 13, 2016
1 parent 3ac6580 commit de69813
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xbmc/cores/VideoPlayer/VideoPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,12 @@ void CVideoPlayer::HandlePlaySpeed()
CLog::Log(LOGDEBUG, "VideoPlayer::Sync - Video - pts: %f, cache: %f, totalcache: %f",
m_CurrentVideo.starttime, m_CurrentVideo.cachetime, m_CurrentVideo.cachetotal);

if (m_CurrentAudio.starttime != DVD_NOPTS_VALUE && m_CurrentAudio.packets > 0)
if (m_CurrentVideo.starttime != DVD_NOPTS_VALUE && m_CurrentVideo.packets > 0 &&
m_playSpeed == DVD_PLAYSPEED_PAUSE)
{
clock = m_CurrentVideo.starttime;
}
else if (m_CurrentAudio.starttime != DVD_NOPTS_VALUE && m_CurrentAudio.packets > 0)
{
if (m_pInputStream->IsRealtime())
clock = m_CurrentAudio.starttime - m_CurrentAudio.cachetotal - DVD_MSEC_TO_TIME(400);
Expand All @@ -2012,11 +2017,13 @@ void CVideoPlayer::HandlePlaySpeed()
{
clock = m_CurrentVideo.starttime - m_CurrentVideo.cachetotal;
}

if (m_omxplayer_mode)
{
CLog::Log(LOGDEBUG, "%s::%s player started RESET", "CVideoPlayer", __FUNCTION__);
m_OmxPlayerState.av_clock.OMXReset(m_CurrentVideo.id >= 0, m_playSpeed != DVD_PLAYSPEED_NORMAL && m_playSpeed != DVD_PLAYSPEED_PAUSE ? false: (m_CurrentAudio.id >= 0));
}

m_clock.Discontinuity(clock);
m_CurrentAudio.syncState = IDVDStreamPlayer::SYNC_INSYNC;
m_CurrentAudio.avsync = CCurrentStream::AV_SYNC_NONE;
Expand Down

0 comments on commit de69813

Please sign in to comment.