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