mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +02:00
Improve stop and rewind logic for openal
This commit is contained in:
@@ -89,6 +89,7 @@ namespace openal
|
||||
if(!i->first->update())
|
||||
{
|
||||
i->first->stopAtomic();
|
||||
i->first->rewindAtomic();
|
||||
i->first->release();
|
||||
available.push(i->second);
|
||||
playing.erase(i);
|
||||
|
||||
@@ -153,9 +153,7 @@ namespace openal
|
||||
alSourcei(source, AL_LOOPING, isLooping() ? AL_TRUE : AL_FALSE);
|
||||
return !isStopped();
|
||||
}
|
||||
else if (type == TYPE_STREAM)
|
||||
{
|
||||
if (isLooping() || !isFinished())
|
||||
else if (type == TYPE_STREAM && (isLooping() || !isFinished()))
|
||||
{
|
||||
// Number of processed buffers.
|
||||
ALint processed;
|
||||
@@ -192,17 +190,6 @@ namespace openal
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Actually stop the source,
|
||||
// 'just running out' is bad
|
||||
// practice, and prevents
|
||||
// rewinds.
|
||||
stopAtomic();
|
||||
rewindAtomic();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user