From ac95edc80ff0529feeb548fcecdb429760ea0478 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 28 Sep 2016 20:18:18 +0200 Subject: VideoPlayer: drop some outdated comments --- xbmc/cores/VideoPlayer/VideoPlayer.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index 31bcc8e680..6916251f34 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -2771,12 +2771,6 @@ void CVideoPlayer::HandleMessages() m_messenger.Put(new CDVDMsgPlayerSeek(iTime, m_playSpeed < 0, true, false, false, true)); } - // if playspeed is different then DVD_PLAYSPEED_NORMAL or DVD_PLAYSPEED_PAUSE - // audioplayer, stops outputing audio to audiorendere, but still tries to - // sleep an correct amount for each packet - // videoplayer just plays faster after the clock speed has been increased - // 1. disable audio - // 2. skip frames and adjust their pts or the clock m_playSpeed = speed; m_newPlaySpeed = speed; m_caching = CACHESTATE_DONE; -- cgit v1.2.3 From 433f59441c54ff03326f617b011a28a60d9e953a Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 28 Sep 2016 20:23:11 +0200 Subject: VideoPlayer: make omx alternative code path more obvious --- xbmc/cores/VideoPlayer/VideoPlayer.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index 6916251f34..c600feac3d 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -2744,6 +2744,19 @@ void CVideoPlayer::HandleMessages() } // do a seek after rewind, clock is not in sync with current pts + if ((speed == DVD_PLAYSPEED_NORMAL) && + (m_playSpeed != DVD_PLAYSPEED_NORMAL) && + (m_playSpeed != DVD_PLAYSPEED_PAUSE) && + !m_omxplayer_mode) + { + int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset); + if (m_State.time != DVD_NOPTS_VALUE) + iTime = m_State.time; + m_messenger.Put(new CDVDMsgPlayerSeek(iTime, m_playSpeed < 0, true, false, false, true)); + } + + // !!! omx alterative code path !!! + // should be done differently if (m_omxplayer_mode) { // when switching from trickplay to normal, we may not have a full set of reference frames @@ -2761,15 +2774,6 @@ void CVideoPlayer::HandleMessages() m_OmxPlayerState.av_clock.OMXSetSpeed(speed); CLog::Log(LOGDEBUG, "%s::%s CDVDMsg::PLAYER_SETSPEED speed : %d (%d)", "CVideoPlayer", __FUNCTION__, speed, static_cast(m_playSpeed)); } - else if ((speed == DVD_PLAYSPEED_NORMAL) && - (m_playSpeed != DVD_PLAYSPEED_NORMAL) && - (m_playSpeed != DVD_PLAYSPEED_PAUSE)) - { - int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset); - if (m_State.time != DVD_NOPTS_VALUE) - iTime = m_State.time; - m_messenger.Put(new CDVDMsgPlayerSeek(iTime, m_playSpeed < 0, true, false, false, true)); - } m_playSpeed = speed; m_newPlaySpeed = speed; -- cgit v1.2.3 From 63e86c44a4f6b0d1b992de3edf42390a5beaf395 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 28 Sep 2016 20:25:01 +0200 Subject: VideoPlayer: coding style fixes --- xbmc/cores/VideoPlayer/VideoPlayer.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index c600feac3d..8933b23cb4 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -2722,16 +2722,18 @@ void CVideoPlayer::HandleMessages() int speed = static_cast(pMsg)->m_value; // correct our current clock, as it would start going wrong otherwise - if(m_State.timestamp > 0) + if (m_State.timestamp > 0) { double offset; - offset = m_clock.GetAbsoluteClock() - m_State.timestamp; + offset = m_clock.GetAbsoluteClock() - m_State.timestamp; offset *= m_playSpeed / DVD_PLAYSPEED_NORMAL; - offset = DVD_TIME_TO_MSEC(offset); - if(offset > 1000) offset = 1000; - if(offset < -1000) offset = -1000; - m_State.time += offset; - m_State.timestamp = m_clock.GetAbsoluteClock(); + offset = DVD_TIME_TO_MSEC(offset); + if (offset > 1000) + offset = 1000; + if (offset < -1000) + offset = -1000; + m_State.time += offset; + m_State.timestamp = m_clock.GetAbsoluteClock(); } if (speed != DVD_PLAYSPEED_PAUSE && m_playSpeed != DVD_PLAYSPEED_PAUSE && speed != m_playSpeed) -- cgit v1.2.3 From cab6018f0db304dda13896051a14bf05f5c4c1b0 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 28 Sep 2016 20:42:16 +0200 Subject: VideoPlayer: notify gui when a change of playback speed occurs --- xbmc/cores/VideoPlayer/VideoPlayer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index 8933b23cb4..04e6110b8a 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -2739,6 +2739,9 @@ void CVideoPlayer::HandleMessages() if (speed != DVD_PLAYSPEED_PAUSE && m_playSpeed != DVD_PLAYSPEED_PAUSE && speed != m_playSpeed) m_callback.OnPlayBackSpeedChanged(speed / DVD_PLAYSPEED_NORMAL); + // notifiy GUI, skins may want to show the seekbar + g_infoManager.SetDisplayAfterSeek(); + if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER) && speed != m_playSpeed) { CDVDInputStreamPVRManager* pvrinputstream = static_cast(m_pInputStream); -- cgit v1.2.3