Bug 1062293 - Fix opensl's cubeb backend draining. r=kinetik a=lmandel
authorPaul Adenot <paul@paul.cx>
Wed, 03 Sep 2014 15:54:03 +0200
changeset 224772 2a6352464e211ec9a0eb8190475de3a44dd13dc2
parent 224771 94140d5b60085f363115e6dbd730af2b8f4ec828
child 224773 938f95281dd3ff6c1164411b6ec1f7835662d2d2
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, lmandel
bugs1062293
milestone34.0a2
Bug 1062293 - Fix opensl's cubeb backend draining. r=kinetik a=lmandel This ensures the callback won't be called when draining is done.
media/libcubeb/src/cubeb_opensl.c
--- a/media/libcubeb/src/cubeb_opensl.c
+++ b/media/libcubeb/src/cubeb_opensl.c
@@ -76,19 +76,19 @@ static void
 play_callback(SLPlayItf caller, void * user_ptr, SLuint32 event)
 {
   cubeb_stream * stm = user_ptr;
   assert(stm);
   switch (event) {
     case SL_PLAYEVENT_HEADATMARKER:
       pthread_mutex_lock(&stm->mutex);
       assert(stm->draining);
-      stm->draining = 0;
       pthread_mutex_unlock(&stm->mutex);
       stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED);
+      (*stm->play)->SetPlayState(stm->play, SL_PLAYSTATE_STOPPED);
       break;
     default:
       break;
   }
 }
 
 static void
 bufferqueue_callback(SLBufferQueueItf caller, void * user_ptr)