CID:468 MISSING_LOCK
authorNelson Ferreira <nelson.ferreira@ieee.org>
Sat, 17 Sep 2011 01:56:13 +0000 (21:56 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Sat, 17 Sep 2011 01:56:13 +0000 (21:56 -0400)
* src/media/sound-alsa.c (sound_alsa_play): Add the lock around aj->play_state

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/media/sound-alsa.c

index e01160e..34293de 100644 (file)
@@ -625,7 +625,9 @@ sound_alsa_play(audio_job_t aj)
                                mss, aj->buffer, resolution);
                        if (!len) {
                                ALSA_DEBUG_S("finished\n");
+                               SXE_MUTEX_LOCK(&aj->mtx);
                                aj->play_state = MTPSTATE_STOP;
+                               SXE_MUTEX_UNLOCK(&aj->mtx);
                                break;
                        }