Fix looping streamable audio clips with multiple chunks

This commit is contained in:
Wojciech Figat
2022-07-26 14:36:50 +02:00
parent cfb98a39b0
commit 9d26004864
4 changed files with 13 additions and 42 deletions

View File

@@ -367,10 +367,11 @@ void AudioBackendOAL::Source_PitchChanged(AudioSource* source)
void AudioBackendOAL::Source_IsLoopingChanged(AudioSource* source)
{
const bool loop = source->GetIsLooping() && !source->UseStreaming();
ALC_FOR_EACH_CONTEXT()
const uint32 sourceID = source->SourceIDs[i];
alSourcei(sourceID, AL_LOOPING, source->GetIsLooping());
alSourcei(sourceID, AL_LOOPING, loop);
}
}
@@ -398,8 +399,7 @@ void AudioBackendOAL::Source_ClipLoaded(AudioSource* source)
return;
const auto clip = source->Clip.Get();
const bool is3D = source->Is3D();
const bool isStreamable = clip->IsStreamable();
const bool loop = source->GetIsLooping() && !isStreamable;
const bool loop = source->GetIsLooping() && !clip->IsStreamable();
ALC_FOR_EACH_CONTEXT()
const uint32 sourceID = source->SourceIDs[i];