diff options
author | Chris Robinson <[email protected]> | 2018-03-03 21:57:42 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-03-03 21:57:42 -0800 |
commit | 179e1c4dbc143c9df50676ce538f628690799cd3 (patch) | |
tree | 98299a4841c6bb09aef87a72697e4e1651a91974 /OpenAL32/alSource.c | |
parent | 945d74cbc9dfa41c325efc029f2a4069dfcf9317 (diff) |
Don't check for space in the ringbuffer before trying to write
The write method already checks and returns how much it managed to fit in.
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 02511382..40b2c494 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -248,9 +248,8 @@ static void SendStateChangeEvent(ALCcontext *context, ALuint id, ALenum state) * and we don't want state change messages to occur out of order, so send * it through the async queue to ensure proper ordering. */ - if(ll_ringbuffer_write_space(context->AsyncEvents) > 0) - ll_ringbuffer_write(context->AsyncEvents, (const char*)&evt, 1); - alsem_post(&context->EventSem); + if(ll_ringbuffer_write(context->AsyncEvents, (const char*)&evt, 1) == 1) + alsem_post(&context->EventSem); } |