mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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);
|
||||
auto alspeaker = dynamic_cast<ALSpeaker*>(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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue