aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <92enen@gmail.com>2024-02-13 10:07:18 +0000
committerGitHub <noreply@github.com>2024-02-13 10:07:18 +0000
commit18a5d7b662377b2ef40a5dcc9637bda4a9fc1aac (patch)
tree23f735f4267498b203fed83e662106b0f347eb3c
parent026ee6967b820f2b46d93adc5c89df84fafbc360 (diff)
parent669dad856353ba97a912c106da0892f57a61bedf (diff)
Merge pull request #24701 from enen92/tempo_seek
VideoPlayer: Fix stalls when seeking with tempo enabled
-rw-r--r--xbmc/cores/VideoPlayer/AudioSinkAE.cpp3
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.cpp5
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);