From 497f4dfb31709085dd8b8ba899bd94d4ea5cf332 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 18 Oct 2012 08:03:21 +0200 Subject: [PATCH] (OpenSL ES) Add workaround for OutputMix - setting volume not working with Android OSL ES implementation - seems to fail at init now though --- audio/opensl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/audio/opensl.c b/audio/opensl.c index 02ac3d0be0..9339afa38b 100644 --- a/audio/opensl.c +++ b/audio/opensl.c @@ -235,6 +235,12 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency) /* Setup for audio playback */ + /* As suggested by Google above as a replacement for OutputMix IID_VOLUME - see note */ + sl->res_ptr = (*sl->player)->GetInterface(sl->player, SL_IID_VOLUME, &sl->volumeItf); + + if(sl->res_ptr != SL_RESULT_SUCCESS) + goto error; + sl->res_ptr = (*sl->playItf)->SetPlayState(sl->playItf, SL_PLAYSTATE_PLAYING); if(sl->res_ptr != SL_RESULT_SUCCESS)