Fix disabled streaming audio not resetting state correctly.
This commit is contained in:
@@ -338,6 +338,7 @@ void AudioSource::PlayInternal()
|
||||
AudioBackend::Source::Play(this);
|
||||
|
||||
_isActuallyPlayingSth = true;
|
||||
_startingToPlay = true;
|
||||
}
|
||||
|
||||
#if USE_EDITOR
|
||||
@@ -419,6 +420,23 @@ void AudioSource::Update()
|
||||
AudioBackend::Source::VelocityChanged(this);
|
||||
}
|
||||
|
||||
if (!UseStreaming() && GetTime() == GetStartTime() && _isActuallyPlayingSth && !_startingToPlay)
|
||||
{
|
||||
if (GetIsLooping())
|
||||
{
|
||||
Stop();
|
||||
Play();
|
||||
}
|
||||
else
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
if (_startingToPlay)
|
||||
{
|
||||
_startingToPlay = false;
|
||||
}
|
||||
|
||||
// Skip other update logic if it's not valid streamable source
|
||||
if (!UseStreaming() || SourceIDs.IsEmpty())
|
||||
return;
|
||||
|
||||
@@ -57,6 +57,7 @@ private:
|
||||
bool _clipChanged = false;
|
||||
|
||||
bool _isActuallyPlayingSth = false;
|
||||
bool _startingToPlay = false;
|
||||
bool _needToUpdateStreamingBuffers = false;
|
||||
States _state = States::Stopped;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user