mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
paused stream setTime fix
This commit is contained in:
parent
7cca53fca3
commit
a58fbd7df2
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue