mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:23:54 +00:00
Update the queued sample count immediately
This commit is contained in:
parent
cbdf6ad595
commit
32b0a5d96e
1 changed files with 2 additions and 6 deletions
|
@ -339,8 +339,6 @@ bool OpenAL_SoundStream::process()
|
|||
{
|
||||
try {
|
||||
bool finished = mIsFinished;
|
||||
ALint samples_unqueued = 0;
|
||||
ALint samples_queued = 0;
|
||||
ALint processed, state;
|
||||
|
||||
alGetSourcei(mSource, AL_SOURCE_STATE, &state);
|
||||
|
@ -355,7 +353,7 @@ bool OpenAL_SoundStream::process()
|
|||
size_t got;
|
||||
|
||||
alSourceUnqueueBuffers(mSource, 1, &bufid);
|
||||
samples_unqueued += getBufferSampleCount(bufid);
|
||||
mSamplesQueued -= getBufferSampleCount(bufid);
|
||||
processed--;
|
||||
|
||||
if(finished)
|
||||
|
@ -367,7 +365,7 @@ bool OpenAL_SoundStream::process()
|
|||
{
|
||||
alBufferData(bufid, mFormat, &data[0], got, mSampleRate);
|
||||
alSourceQueueBuffers(mSource, 1, &bufid);
|
||||
samples_queued += getBufferSampleCount(bufid);
|
||||
mSamplesQueued += getBufferSampleCount(bufid);
|
||||
}
|
||||
} while(processed > 0);
|
||||
throwALerror();
|
||||
|
@ -383,8 +381,6 @@ bool OpenAL_SoundStream::process()
|
|||
throwALerror();
|
||||
}
|
||||
|
||||
mSamplesQueued -= samples_unqueued;
|
||||
mSamplesQueued += samples_queued;
|
||||
mIsFinished = finished;
|
||||
}
|
||||
catch(std::exception &e) {
|
||||
|
|
Loading…
Reference in a new issue