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 296734 4af91393a8f8
parent 296733 d720ce07c464
child 296735 1540124e58cd
push id5314
push usercbook@mozilla.com
push date2015-11-16 16:14 +0000
treeherdermozilla-beta@4af91393a8f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, sylvestre
bugs1221228
milestone43.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) {