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

Commit b78db64e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Print extra error code if LDAC encoder fails to initialize"

parents 4f867958 d1422c03
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -359,6 +359,7 @@ static void a2dp_vendor_ldac_encoder_update(uint16_t peer_mtu,
    }
    a2dp_ldac_encoder_cb.has_ldac_handle = true;
  }
  CHECK(a2dp_ldac_encoder_cb.ldac_handle != nullptr);

  if (!a2dp_codec_config->copyOutOtaCodecConfig(codec_info)) {
    LOG_ERROR(LOG_TAG,
@@ -494,8 +495,13 @@ static void a2dp_vendor_ldac_encoder_update(uint16_t peer_mtu,
      p_encoder_params->channel_mode, p_encoder_params->pcm_fmt,
      p_encoder_params->sample_rate);
  if (result != 0) {
    LOG_ERROR(LOG_TAG, "%s: error initializing the LDAC encoder: %d", __func__,
              result);
    int err_code = ldac_get_error_code_func(a2dp_ldac_encoder_cb.ldac_handle);
    LOG_ERROR(LOG_TAG,
              "%s: error initializing the LDAC encoder: %d api_error = %d "
              "handle_error = %d block_error = %d error_code = 0x%x",
              __func__, result, LDACBT_API_ERR(err_code),
              LDACBT_HANDLE_ERR(err_code), LDACBT_BLOCK_ERR(err_code),
              err_code);
  }
}

@@ -659,9 +665,10 @@ static void a2dp_ldac_encode_frames(uint8_t nb_frame) {
              ldac_get_error_code_func(a2dp_ldac_encoder_cb.ldac_handle);
          LOG_ERROR(LOG_TAG,
                    "%s: LDAC encoding error: %d api_error = %d "
                    "handle_error = %d block_error = %d",
                    "handle_error = %d block_error = %d error_code = 0x%x",
                    __func__, result, LDACBT_API_ERR(err_code),
                    LDACBT_HANDLE_ERR(err_code), LDACBT_BLOCK_ERR(err_code));
                    LDACBT_HANDLE_ERR(err_code), LDACBT_BLOCK_ERR(err_code),
                    err_code);
          a2dp_ldac_encoder_cb.stats.media_read_total_dropped_packets++;
          osi_free(p_buf);
          return;