mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
a2dp_sink_demo: start audio playback when buffer has minimum level of sbc frames
This commit is contained in:
parent
6c5b303c0f
commit
6f98ada7f0
@ -512,11 +512,7 @@ static void handle_l2cap_media_data_packet(uint8_t seid, uint8_t *packet, uint16
|
|||||||
|
|
||||||
// start stream if enough frames buffered
|
// start stream if enough frames buffered
|
||||||
if (!audio_stream_started && sbc_frames_in_buffer >= OPTIMAL_FRAMES_MIN){
|
if (!audio_stream_started && sbc_frames_in_buffer >= OPTIMAL_FRAMES_MIN){
|
||||||
audio_stream_started = 1;
|
media_processing_start();
|
||||||
// setup audio playback
|
|
||||||
if (audio){
|
|
||||||
audio->start_stream();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -928,7 +924,7 @@ static void a2dp_sink_packet_handler(uint8_t packet_type, uint16_t channel, uint
|
|||||||
|
|
||||||
case A2DP_SUBEVENT_STREAM_STARTED:
|
case A2DP_SUBEVENT_STREAM_STARTED:
|
||||||
printf("A2DP Sink : Stream started\n");
|
printf("A2DP Sink : Stream started\n");
|
||||||
media_processing_start();
|
// audio stream is started when buffer reaches minimal level
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case A2DP_SUBEVENT_STREAM_SUSPENDED:
|
case A2DP_SUBEVENT_STREAM_SUSPENDED:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user