mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 15:53:54 +00:00
Merge pull request #1179 from Armada651/fix-audio-cutoff
OpenAL_Output: When a source is finished, rewind it instead of stopping it.
This commit is contained in:
commit
da3815f5a6
1 changed files with 10 additions and 2 deletions
|
@ -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…
Reference in a new issue