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

Commit 919be793 authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "leaudio: Fix sending audio data to TWS style earbuds" am: 955222bd...

Merge "leaudio: Fix sending audio data to TWS style earbuds" am: 955222bd am: 050cfa45 am: 4e903809

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2117356



Change-Id: If4c6fc122e4049de5a665216a1f660886b536cc1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b2d456aa 4e903809
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2042,7 +2042,7 @@ class LeAudioClientImpl : public LeAudioClient {
    return mono_out;
  }

  void PrepareAndSendToTwoDevices(
  void PrepareAndSendToTwoCises(
      const std::vector<uint8_t>& data,
      struct le_audio::stream_configuration* stream_conf) {
    uint16_t byte_count = stream_conf->sink_octets_per_codec_frame;
@@ -2112,7 +2112,7 @@ class LeAudioClientImpl : public LeAudioClient {
          right_cis_handle, chan_right_enc.data(), chan_right_enc.size());
  }

  void PrepareAndSendToSingleDevice(
  void PrepareAndSendToSingleCis(
      const std::vector<uint8_t>& data,
      struct le_audio::stream_configuration* stream_conf) {
    int num_channels = stream_conf->sink_num_of_channels;
@@ -2295,9 +2295,12 @@ class LeAudioClientImpl : public LeAudioClient {
    }

    if (stream_conf.sink_num_of_devices == 2) {
      PrepareAndSendToTwoDevices(data, &stream_conf);
      PrepareAndSendToTwoCises(data, &stream_conf);
    } else if (stream_conf.sink_streams.size() == 2 ) {
      /* Streaming to one device but 2 CISes */
      PrepareAndSendToTwoCises(data, &stream_conf);
    } else {
      PrepareAndSendToSingleDevice(data, &stream_conf);
      PrepareAndSendToSingleCis(data, &stream_conf);
    }
  }