From 23b3ea18564315be8a57c34f3135e2762f6fdae6 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Fri, 21 Feb 2014 11:58:19 +0100 Subject: [PATCH] Background Music should now stop correctly when switch is OFF --- radio/src/audio_arm.cpp | 2 +- radio/src/opentx.cpp | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index 1340ccd7d..7a2bb3468 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -622,7 +622,7 @@ void AudioQueue::wakeup() } // mix the background context - if (!isFunctionActive(FUNCTION_BACKGND_MUSIC_PAUSE)) { + if (isFunctionActive(FUNCTION_BACKGND_MUSIC) && !isFunctionActive(FUNCTION_BACKGND_MUSIC_PAUSE)) { result = backgroundContext.mixBuffer(buffer, g_eeGeneral.backgroundVolume, fade); if (result > 0) { size = max(size, result); diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 3fbd2d5e6..2be47461e 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -3259,7 +3259,7 @@ void evalFunctions() if (active || IS_PLAY_BOTH_FUNC(CFN_FUNC(sd))) { - switch(CFN_FUNC(sd)) { + switch (CFN_FUNC(sd)) { case FUNC_SAFETY_CHANNEL: safetyCh[CFN_CH_INDEX(sd)] = CFN_PARAM(sd); @@ -3479,11 +3479,6 @@ void evalFunctions() lastFunctionTime[i] = 0; #if defined(CPUARM) fnSwitchDuration[i] = 0; -#endif -#if defined(CPUARM) && defined(SDCARD) - if (CFN_FUNC(sd) == FUNC_BACKGND_MUSIC && isFunctionActive(FUNCTION_BACKGND_MUSIC)) { - STOP_PLAY(i+1); - } #endif } }