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

Commit ef2908fd authored by Cheney Ni's avatar Cheney Ni Committed by android-build-merger
Browse files

Merge "Refresh the encoder configuration of software while updating the MTU"...

Merge "Refresh the encoder configuration of software while updating the MTU" am: a0a6b44f am: 4843a98f am: e3ce5360
am: f10054d1

Change-Id: I3b95fe09ef43ef3f1b371f2430d2478ba5863b77
parents 40676051 f10054d1
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1385,7 +1385,20 @@ void BtaAvCo::UpdateMtu(tBTA_AV_HNDL bta_av_handle,
        __func__, bta_av_handle, peer_address.ToString().c_str());
    return;
  }

  if (p_peer->mtu == mtu) return;

  p_peer->mtu = mtu;
  if (active_peer_ == p_peer) {
    LOG(INFO) << __func__ << ": update the codec encoder with peer "
              << peer_address << " bta_av_handle: " << loghex(bta_av_handle)
              << ", new MTU: " << mtu;
    // Send a request with NONE config values to update only the MTU.
    SetCodecAudioConfig(
        {.sample_rate = BTAV_A2DP_CODEC_SAMPLE_RATE_NONE,
         .bits_per_sample = BTAV_A2DP_CODEC_BITS_PER_SAMPLE_NONE,
         .channel_mode = BTAV_A2DP_CODEC_CHANNEL_MODE_NONE});
  }
}

bool BtaAvCo::SetActivePeer(const RawAddress& peer_address) {