Bug 1221228 - Work around busted OpenSL causing hangs/reboots on Android. r=padenot, a=sylvestre
authorJames Willcox <snorp@snorp.net>
Thu, 12 Nov 2015 14:52:42 -0600
changeset 305505 a8608fc16c09c13e018c6007b9d7c211872bd202
parent 305504 eaf685ae45f1650edcec546d6e0b3abae5bfd5e2
child 305506 687f98cac21223f633d2ecec2925ef3a4c17eab8
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, sylvestre
bugs1221228
milestone44.0a2
Bug 1221228 - Work around busted OpenSL causing hangs/reboots on Android. r=padenot, a=sylvestre
media/libcubeb/src/cubeb_opensl.c
--- a/media/libcubeb/src/cubeb_opensl.c
+++ b/media/libcubeb/src/cubeb_opensl.c
@@ -636,16 +636,19 @@ opensl_stream_init(cubeb * ctx, cubeb_st
   }
 
   res = (*stm->play)->RegisterCallback(stm->play, play_callback, stm);
   if (res != SL_RESULT_SUCCESS) {
     opensl_stream_destroy(stm);
     return CUBEB_ERROR;
   }
 
+  // Work around wilhelm/AudioTrack badness, bug 1221228
+  (*stm->play)->SetMarkerPosition(stm->play, (SLmillisecond)0);
+
   res = (*stm->play)->SetCallbackEventsMask(stm->play, (SLuint32)SL_PLAYEVENT_HEADATMARKER);
   if (res != SL_RESULT_SUCCESS) {
     opensl_stream_destroy(stm);
     return CUBEB_ERROR;
   }
 
   res = (*stm->bufq)->RegisterCallback(stm->bufq, bufferqueue_callback, stm);
   if (res != SL_RESULT_SUCCESS) {