Rework auto playback frequency switch

Moved logic outside playback events to be executed early. Stops buffering when frequency change is detected (additional STATE_STOPPED state is introduced)

Removed no longer used AUDIO_START_REFRESH flag

Change-Id: Icfae61725a4d8ffb47380f561a011bda4841457b
This commit is contained in:
roman.artiukhin 2023-10-02 19:19:09 +03:00 committed by Aidan MacDonald
parent 90e35716e3
commit 831faa3b82
2 changed files with 54 additions and 52 deletions

View file

@ -23,7 +23,7 @@
#include "kernel.h"
/* Define LOGF_ENABLE to enable logf output in this file */
/*#define LOGF_ENABLE*/
//#define LOGF_ENABLE
#include "logf.h"
#include "audio.h"
#include "sound.h"
@ -314,7 +314,7 @@ void pcm_play_stop(void)
* what pcm_apply_settings will set */
void pcm_set_frequency(unsigned int samplerate)
{
logf("pcm_set_frequency");
logf("pcm_set_frequency %u", samplerate);
int index;