|
|
@@ -435,7 +435,11 @@ pull_used_buffers() {
|
|
|
ReMutexHolder holder(OpenALAudioManager::_lock);
|
|
|
while (_stream_queued.size()) {
|
|
|
ALuint buffer = 0;
|
|
|
- alGetError();
|
|
|
+ ALint num_buffers = 0;
|
|
|
+ alGetSourcei(_source, AL_BUFFERS_PROCESSED, &num_buffers);
|
|
|
+ if (num_buffers <= 0) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
alSourceUnqueueBuffers(_source, 1, &buffer);
|
|
|
int err = alGetError();
|
|
|
if (err == AL_NO_ERROR) {
|