From 9fd288c0b90c7cf5eaecdae90f46dfa9733555fa Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 20 Dec 2015 15:04:20 -0800 Subject: [PATCH] Remove aggressive assert that fired on Cyanogen device (even with a valid CPU pause/resume lifecycle) ... --- src/audio/soundcore-opensles.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/audio/soundcore-opensles.c b/src/audio/soundcore-opensles.c index 9591b640..b4af766e 100644 --- a/src/audio/soundcore-opensles.c +++ b/src/audio/soundcore-opensles.c @@ -741,20 +741,17 @@ static long opensles_systemResume(AudioContext_s *audio_context) { break; } -#if !TESTING - assert(state != SL_PLAYSTATE_PLAYING && "mismatch between systemPause/systemResume"); -#endif + if (state != SL_PLAYSTATE_PLAYING) { + ERRLOG("WARNING: possible audio lifecycle mismatch ... continuing anyway"); + } if (state == SL_PLAYSTATE_PAUSED) { // Balanced resume OK here SLresult result = (*(ctx->bqPlayerPlay))->SetPlayState(ctx->bqPlayerPlay, SL_PLAYSTATE_PLAYING); -#if !TESTING - } else { + } else if (state == SL_PLAYSTATE_STOPPED) { // Do not resume for stopped state, let this get forced from CPU/speaker thread otherwise we starve. (The // stopped state happens if user dynamically changed buffer parameters in menu settings which triggered an // OpenSLES destroy/re-initialization ... e.g. audio_setLatency() was invoked) - assert(state == SL_PLAYSTATE_STOPPED); -#endif } } while (0);