Bug 1221228 - Work around busted OpenSL causing hangs/reboots on Android r=padenot
authorJames Willcox <snorp@snorp.net>
Thu, 12 Nov 2015 14:52:42 -0600
changeset 272424 84c21e328c7433092e8b41683bf750697da04867
parent 272423 65025d08a5fb1e15b7c650d49e28d823ff142fd9
child 272425 d8527c812156ab237b70dc281830b957e982f8b9
push id67958
push userjwillcox@mozilla.com
push dateFri, 13 Nov 2015 14:40:57 +0000
treeherdermozilla-inbound@84c21e328c74 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1221228
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1221228 - Work around busted OpenSL causing hangs/reboots on Android r=padenot
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) {