paused stream setTime fix
This commit is contained in:
@@ -169,11 +169,15 @@ void ALStream::setTime(duration_t time) {
|
|||||||
source->seek(sample);
|
source->seek(sample);
|
||||||
auto alspeaker = dynamic_cast<ALSpeaker*>(audio::get_speaker(this->speaker));
|
auto alspeaker = dynamic_cast<ALSpeaker*>(audio::get_speaker(this->speaker));
|
||||||
if (alspeaker) {
|
if (alspeaker) {
|
||||||
|
bool paused = alspeaker->isPaused();
|
||||||
AL_CHECK(alSourceStop(alspeaker->source));
|
AL_CHECK(alSourceStop(alspeaker->source));
|
||||||
unqueueBuffers(alspeaker->source);
|
unqueueBuffers(alspeaker->source);
|
||||||
totalPlayedSamples = sample;
|
totalPlayedSamples = sample;
|
||||||
enqueueBuffers(alspeaker->source);
|
enqueueBuffers(alspeaker->source);
|
||||||
AL_CHECK(alSourcePlay(alspeaker->source));
|
AL_CHECK(alSourcePlay(alspeaker->source));
|
||||||
|
if (paused) {
|
||||||
|
AL_CHECK(alSourcePause(alspeaker->source));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
totalPlayedSamples = sample;
|
totalPlayedSamples = sample;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user