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

Commit 5ea759a4 authored by Ted Wang's avatar Ted Wang
Browse files

Check if need codec switching before start streaming

Bug: 226441860
Test: run sink device using bds-dev
Tag: #feature
Ignore-AOSP-First: TM QPR1 Feature
Change-Id: Ic7bccdc29abcb3861eda4620904e9372e3814d3c
parent d2eb9a08
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -84,6 +84,8 @@ BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) {
    return a2dp_ack_to_bt_audio_ctrl_ack(A2DP_CTRL_ACK_SUCCESS);
  }
  if (btif_av_stream_ready()) {
    // check if codec needs to be switched prior to stream start
    invoke_switch_codec_cb(is_low_latency);
    /*
     * Post start event and wait for audio path to open.
     * If we are the source, the ACK will be sent after the start
@@ -96,7 +98,6 @@ BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) {
      return a2dp_ack_to_bt_audio_ctrl_ack(A2DP_CTRL_ACK_PENDING);
    }
    a2dp_pending_cmd_ = A2DP_CTRL_CMD_NONE;
    invoke_switch_codec_cb(is_low_latency);
    return a2dp_ack_to_bt_audio_ctrl_ack(A2DP_CTRL_ACK_SUCCESS);
  }
  LOG(ERROR) << __func__ << ": AV stream is not ready to start";