From f45a46c362c81b0c78e094befb41569e7545e1d6 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 29 May 2017 12:31:35 +0200 Subject: [PATCH] test/avdtp: avdtp source only request to send once --- test/avdtp/avdtp_source_demo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/avdtp/avdtp_source_demo.c b/test/avdtp/avdtp_source_demo.c index 70ca5678e..ce607551e 100644 --- a/test/avdtp/avdtp_source_demo.c +++ b/test/avdtp/avdtp_source_demo.c @@ -306,9 +306,9 @@ static void avdtp_fill_audio_buffer_timeout_handler(btstack_timer_source_t * tim context->time_audio_data_sent = now; context->samples_ready += num_samples; - if (!context->sbc_ready_to_send){ - fill_sbc_audio_buffer(context); - } + if (!context->sbc_ready_to_send) return; + + fill_sbc_audio_buffer(context); if ((context->sbc_storage_count + btstack_sbc_encoder_sbc_buffer_length()) > context->max_media_payload_size){ // schedule sending