nacl: unlock audio thread mutex when done with it.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 01 Aug 2016 11:47:02 -0400
changeset 10216 d188ffeca506
parent 10215 3fbf4a6c6101
child 10217 cd7beec0f654
nacl: unlock audio thread mutex when done with it.
src/audio/nacl/SDL_naclaudio.c
--- a/src/audio/nacl/SDL_naclaudio.c	Mon Aug 01 11:45:45 2016 -0400
+++ b/src/audio/nacl/SDL_naclaudio.c	Mon Aug 01 11:47:02 2016 -0400
@@ -51,7 +51,7 @@
 static void nacl_audio_callback(void* samples, uint32_t buffer_size, PP_TimeDelta latency, void* data) {
     SDL_AudioDevice* _this = (SDL_AudioDevice*) data;
     
-    SDL_LockMutex(private->mutex);
+    SDL_LockMutex(private->mutex);  /* !!! FIXME: is this mutex necessary? */
 
     if (_this->enabled && !_this->paused) {
         if (_this->convert.needed) {
@@ -71,7 +71,7 @@
         SDL_memset(samples, 0, buffer_size);
     }
     
-    return;
+    SDL_UnlockMutex(private->mutex);
 }
 
 static void NACLAUD_CloseDevice(SDL_AudioDevice *device) {