Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cfe3789 authored by Henri Chataing's avatar Henri Chataing
Browse files

btif_a2dp_source: Suppress underflow warning after stream is stopped

Bug: 331817295
Test: m com.android.btservices
Flag: EXEMPT, no logical change
Change-Id: I8579f3af9589a2744f7f534872c4685776767c28
parent 9479db36
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -915,9 +915,13 @@ static void btif_a2dp_source_audio_handle_timer(void) {
}

static uint32_t btif_a2dp_source_read_callback(uint8_t* p_buf, uint32_t len) {
  if (!btif_a2dp_source_cb.sw_audio_is_encoding) {
    return 0;
  }

  uint32_t bytes_read = bluetooth::audio::a2dp::read(p_buf, len);

  if (btif_a2dp_source_cb.sw_audio_is_encoding && bytes_read < len) {
  if (bytes_read < len) {
    log::warn("UNDERFLOW: ONLY READ {} BYTES OUT OF {}", bytes_read, len);
    btif_a2dp_source_cb.stats.media_read_total_underflow_bytes += (len - bytes_read);
    btif_a2dp_source_cb.stats.media_read_total_underflow_count++;