Bug 1142746 - Make unexpected SL_PLAYEVENT_HEADATMARKER notification non-fatal. r=brsun, a=lsblakk
authorMatthew Gregan <kinetik@flim.org>
Tue, 17 Mar 2015 13:30:40 +1300
changeset 250425 067f83e99f66
parent 250424 6a4e68222995
child 250426 6a9120be7216
push id4583
push userryanvm@gmail.com
push date2015-03-18 16:53 +0000
treeherdermozilla-beta@067f83e99f66 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbrsun, lsblakk
bugs1142746
milestone37.0
Bug 1142746 - Make unexpected SL_PLAYEVENT_HEADATMARKER notification non-fatal. r=brsun, a=lsblakk
media/libcubeb/src/cubeb_opensl.c
--- a/media/libcubeb/src/cubeb_opensl.c
+++ b/media/libcubeb/src/cubeb_opensl.c
@@ -71,24 +71,27 @@ struct cubeb_stream {
   unsigned int outputrate;
   unsigned int latency;
 };
 
 static void
 play_callback(SLPlayItf caller, void * user_ptr, SLuint32 event)
 {
   cubeb_stream * stm = user_ptr;
+  int draining;
   assert(stm);
   switch (event) {
   case SL_PLAYEVENT_HEADATMARKER:
     pthread_mutex_lock(&stm->mutex);
-    assert(stm->draining);
+    draining = stm->draining;
     pthread_mutex_unlock(&stm->mutex);
-    stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED);
-    (*stm->play)->SetPlayState(stm->play, SL_PLAYSTATE_PAUSED);
+    if (draining) {
+      stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED);
+      (*stm->play)->SetPlayState(stm->play, SL_PLAYSTATE_PAUSED);
+    }
     break;
   default:
     break;
   }
 }
 
 static void
 bufferqueue_callback(SLBufferQueueItf caller, void * user_ptr)