Fix issues with OpenAL audio backend

This commit is contained in:
Wojciech Figat
2022-02-01 17:34:46 +01:00
parent cf6fb07a05
commit 26191935a7
4 changed files with 130 additions and 203 deletions

View File

@@ -102,7 +102,8 @@ void AudioSource::SetAttenuation(float value)
void AudioSource::Play()
{
if (_state == States::Playing)
auto state = _state;
if (state == States::Playing)
return;
if (Clip == nullptr)
{
@@ -120,8 +121,16 @@ void AudioSource::Play()
// Audio clips with disabled streaming are controlled by audio source, otherwise streaming manager will play it
if (Clip->IsStreamable())
{
// Request faster streaming update
Clip->RequestStreamingUpdate();
if (state == States::Paused)
{
// Resume
PlayInternal();
}
else
{
// Request faster streaming update
Clip->RequestStreamingUpdate();
}
}
else
{