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 291339 2e200a84e46ba80f7c6ceeb11fd6b932fe06dc29
parent 291338 3a07245cd1f6ab7e41e0c709711100b69ac10a0e
child 291340 c94a38c7913635a175dc9cb6b91558444bbe9513
push id954
push usercbook@mozilla.com
push dateThu, 19 Nov 2015 08:46:28 +0000
treeherdermozilla-release@c94a38c79136 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, sylvestre
bugs1221228
milestone42.0
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) {