fix bug in OTA leading to freeze during upgrade if music playback is running during upgrade

wait for free space in flac write callback if none can be aquired.

Signed-off-by: Karl Osterseher <karl_osterseher@gmx.at>
This commit is contained in:
Karl Osterseher
2025-03-02 21:13:35 +01:00
Unverified
parent 4eb01805fe
commit cec14ad15b
7 changed files with 2019 additions and 41 deletions

View File

@@ -402,7 +402,7 @@ int dsp_processor_worker(void *p_pcmChnk, const void *p_scSet) {
for (i = 0; i < max; i++) {
int16_t channel0 = (int16_t)((tmp[i] & 0xFFFF0000) >> 16);
int16_t channel1 = (int16_t)(tmp[i] & 0x0000FFFF);
int16_t mixMono = (float)channel0 / 2.0 + (float)channel1 / 2.0;
int16_t mixMono = ((int32_t)channel0 + (int32_t)channel1) / 2;
tmp[i] = ((uint32_t)mixMono << 16) | ((uint32_t)mixMono & 0x0000FFFF);
}