diff options
author | enen92 <92enen@gmail.com> | 2024-02-12 14:42:50 +0000 |
---|---|---|
committer | enen92 <92enen@gmail.com> | 2024-02-12 14:43:11 +0000 |
commit | 669dad856353ba97a912c106da0892f57a61bedf (patch) | |
tree | 23f735f4267498b203fed83e662106b0f347eb3c | |
parent | 026ee6967b820f2b46d93adc5c89df84fafbc360 (diff) |
VideoPlayer: Fix stalls when seeking with tempo enabled
-rw-r--r-- | xbmc/cores/VideoPlayer/AudioSinkAE.cpp | 3 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/xbmc/cores/VideoPlayer/AudioSinkAE.cpp b/xbmc/cores/VideoPlayer/AudioSinkAE.cpp index 0af936fde2..7e9fb0a629 100644 --- a/xbmc/cores/VideoPlayer/AudioSinkAE.cpp +++ b/xbmc/cores/VideoPlayer/AudioSinkAE.cpp @@ -112,11 +112,12 @@ unsigned int CAudioSinkAE::AddPackets(const DVDAudioFrame &audioframe) m_syncError = 0.0; } - //Calculate a timeout when this definitely should be done + // Calculate a timeout when this definitely should be done double timeout; timeout = DVD_SEC_TO_TIME(m_pAudioStream->GetDelay()) + audioframe.duration; timeout += DVD_SEC_TO_TIME(1.0); timeout += m_pClock->GetAbsoluteClock(); + timeout *= m_pClock->GetClockSpeed(); unsigned int total = audioframe.nb_frames - audioframe.framesOut; unsigned int frames = total; diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index c93beaa6ac..bf3f606798 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -3989,8 +3989,9 @@ void CVideoPlayer::FlushBuffers(double pts, bool accurate, bool sync) m_VideoPlayerRadioRDS->Flush(); m_VideoPlayerAudioID3->Flush(); - if (m_playSpeed == DVD_PLAYSPEED_NORMAL || - m_playSpeed == DVD_PLAYSPEED_PAUSE) + if (m_playSpeed == DVD_PLAYSPEED_NORMAL || m_playSpeed == DVD_PLAYSPEED_PAUSE || + (m_playSpeed >= DVD_PLAYSPEED_NORMAL * m_processInfo->MinTempoPlatform() && + m_playSpeed <= DVD_PLAYSPEED_NORMAL * m_processInfo->MaxTempoPlatform())) { // make sure players are properly flushed, should put them in stalled state auto msg = std::make_shared<CDVDMsgGeneralSynchronize>(1s, SYNCSOURCE_AUDIO | SYNCSOURCE_VIDEO); |