mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 06:40:09 +00:00
OpenAL_Output: When a source is finished, rewind it instead of stopping it.
This works around a bug in the MacOS OpenAL implementation.
This commit is contained in:
parent
41499ea11f
commit
e9d8ff532f
@ -437,7 +437,9 @@ bool OpenAL_SoundStream::process()
|
||||
alGetSourcei(mSource, AL_SOURCE_STATE, &state);
|
||||
if(state != AL_PLAYING && state != AL_PAUSED)
|
||||
{
|
||||
// Ensure all processed buffers are removed so we don't replay them.
|
||||
refillQueue();
|
||||
|
||||
alSourcePlay(mSource);
|
||||
}
|
||||
}
|
||||
@ -906,7 +908,10 @@ void OpenAL_Output::finishSound(MWBase::SoundPtr sound)
|
||||
ALuint source = GET_PTRID(sound->mHandle);
|
||||
sound->mHandle = 0;
|
||||
|
||||
alSourceStop(source);
|
||||
// Rewind the stream instead of stopping it, this puts the source into an AL_INITIAL state,
|
||||
// which works around a bug in the MacOS OpenAL implementation which would otherwise think
|
||||
// the initial queue already played when it hasn't.
|
||||
alSourceRewind(source);
|
||||
alSourcei(source, AL_BUFFER, 0);
|
||||
|
||||
mFreeSources.push_back(source);
|
||||
@ -1006,7 +1011,10 @@ void OpenAL_Output::finishStream(MWBase::SoundStreamPtr sound)
|
||||
sound->mHandle = 0;
|
||||
mStreamThread->remove(stream);
|
||||
|
||||
alSourceStop(source);
|
||||
// Rewind the stream instead of stopping it, this puts the source into an AL_INITIAL state,
|
||||
// which works around a bug in the MacOS OpenAL implementation which would otherwise think
|
||||
// the initial queue already played when it hasn't.
|
||||
alSourceRewind(source);
|
||||
alSourcei(source, AL_BUFFER, 0);
|
||||
|
||||
mFreeSources.push_back(source);
|
||||
|
Loading…
x
Reference in New Issue
Block a user