From 4b3f8617054370b0e96650ee65edea1c23591ed4 Mon Sep 17 00:00:00 2001 From: Dirk Helbig Date: Thu, 1 Feb 2024 13:19:36 +0100 Subject: [PATCH] le_audio_demo_util_sink: fix multi channel decode --- example/le_audio_demo_util_sink.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/example/le_audio_demo_util_sink.c b/example/le_audio_demo_util_sink.c index 1701e72af..38f374335 100644 --- a/example/le_audio_demo_util_sink.c +++ b/example/le_audio_demo_util_sink.c @@ -165,7 +165,7 @@ enum EventSignals { TIME_SIG }; -// #define AUDIO_FSM_DEBUG +#define AUDIO_FSM_DEBUGx #ifdef AUDIO_FSM_DEBUG #define ENUM_TO_TEXT(sig) [sig] = #sig #define audio_fsm_debug(format, ...) \ @@ -450,6 +450,8 @@ static btstack_fsm_state_t audio_processing_waiting( audio_processing_t * const } static void audio_processing_resample( audio_processing_t * const me, data_event_t *e ) { + // mark current packet as handled + e->data = NULL; if( me->have_pcm != ((1<<(le_audio_demo_sink_num_streams*le_audio_demo_sink_num_channels_per_stream))-1) ) { return; } @@ -476,7 +478,6 @@ static void audio_processing_resample( audio_processing_t * const me, data_event printf("Samples dropped\n"); samples_dropped += le_audio_demo_sink_num_samples_per_frame; } - e->data = NULL; me->have_pcm = 0; } @@ -523,7 +524,12 @@ static btstack_fsm_state_t audio_processing_decode( audio_processing_t * const m &data_out[effective_channel], le_audio_demo_sink_num_channels, &tmp_BEC_detect); offset += le_audio_demo_sink_octets_per_frame; - btstack_assert( !(me->have_pcm & (1<have_pcm & (1<have_pcm |= (1<