diff options
author | Chris Robinson <[email protected]> | 2018-02-25 10:05:25 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-02-25 10:05:25 -0800 |
commit | 654a45833acb4ba3eb6c71906346fcd60034cb41 (patch) | |
tree | b4db7863abbf5509602a86c127bbbfdee6dceac2 /Alc | |
parent | 455763aa9a1e46470ffb2baf1ecb12e7276f8fb2 (diff) |
Only send one buffer completed event per update
The 'param' callback parameter indicates the number of buffers that were
completed.
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/mixer.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 4946cb7b..96a5335b 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -774,11 +774,9 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize enabledevt = ATOMIC_LOAD(&Context->EnabledEvts, almemory_order_acquire); if(buffers_done > 0 && (enabledevt&EventType_BufferCompleted)) { - do { - SendAsyncEvent(Context, EventType_BufferCompleted, - AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT, SourceID, 0, "Buffer completed" - ); - } while(--buffers_done > 0); + SendAsyncEvent(Context, EventType_BufferCompleted, + AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT, SourceID, buffers_done, "Buffer completed" + ); alsem_post(&Context->EventSem); } |