mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 00:06:43 +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 {
|
try {
|
||||||
bool finished = mIsFinished;
|
bool finished = mIsFinished;
|
||||||
ALint samples_unqueued = 0;
|
|
||||||
ALint samples_queued = 0;
|
|
||||||
ALint processed, state;
|
ALint processed, state;
|
||||||
|
|
||||||
alGetSourcei(mSource, AL_SOURCE_STATE, &state);
|
alGetSourcei(mSource, AL_SOURCE_STATE, &state);
|
||||||
|
@ -355,7 +353,7 @@ bool OpenAL_SoundStream::process()
|
||||||
size_t got;
|
size_t got;
|
||||||
|
|
||||||
alSourceUnqueueBuffers(mSource, 1, &bufid);
|
alSourceUnqueueBuffers(mSource, 1, &bufid);
|
||||||
samples_unqueued += getBufferSampleCount(bufid);
|
mSamplesQueued -= getBufferSampleCount(bufid);
|
||||||
processed--;
|
processed--;
|
||||||
|
|
||||||
if(finished)
|
if(finished)
|
||||||
|
@ -367,7 +365,7 @@ bool OpenAL_SoundStream::process()
|
||||||
{
|
{
|
||||||
alBufferData(bufid, mFormat, &data[0], got, mSampleRate);
|
alBufferData(bufid, mFormat, &data[0], got, mSampleRate);
|
||||||
alSourceQueueBuffers(mSource, 1, &bufid);
|
alSourceQueueBuffers(mSource, 1, &bufid);
|
||||||
samples_queued += getBufferSampleCount(bufid);
|
mSamplesQueued += getBufferSampleCount(bufid);
|
||||||
}
|
}
|
||||||
} while(processed > 0);
|
} while(processed > 0);
|
||||||
throwALerror();
|
throwALerror();
|
||||||
|
@ -383,8 +381,6 @@ bool OpenAL_SoundStream::process()
|
||||||
throwALerror();
|
throwALerror();
|
||||||
}
|
}
|
||||||
|
|
||||||
mSamplesQueued -= samples_unqueued;
|
|
||||||
mSamplesQueued += samples_queued;
|
|
||||||
mIsFinished = finished;
|
mIsFinished = finished;
|
||||||
}
|
}
|
||||||
catch(std::exception &e) {
|
catch(std::exception &e) {
|
||||||
|
|
Loading…
Reference in a new issue