From a58fbd7df233747b50f5bb35dbf91d373ded03a0 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 6 Mar 2024 23:29:08 +0300 Subject: [PATCH] paused stream setTime fix --- src/audio/AL/ALAudio.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/audio/AL/ALAudio.cpp b/src/audio/AL/ALAudio.cpp index 5e47f7b8..72627dae 100644 --- a/src/audio/AL/ALAudio.cpp +++ b/src/audio/AL/ALAudio.cpp @@ -169,11 +169,15 @@ void ALStream::setTime(duration_t time) { source->seek(sample); auto alspeaker = dynamic_cast(audio::get_speaker(this->speaker)); if (alspeaker) { + bool paused = alspeaker->isPaused(); AL_CHECK(alSourceStop(alspeaker->source)); unqueueBuffers(alspeaker->source); totalPlayedSamples = sample; enqueueBuffers(alspeaker->source); AL_CHECK(alSourcePlay(alspeaker->source)); + if (paused) { + AL_CHECK(alSourcePause(alspeaker->source)); + } } else { totalPlayedSamples = sample; }