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

Commit 955222bd authored by Jack He's avatar Jack He Committed by Gerrit Code Review
Browse files

Merge "leaudio: Fix sending audio data to TWS style earbuds"

parents cecd0851 f85a7c8c
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2021,7 +2021,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;
@@ -2091,7 +2091,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;
@@ -2274,9 +2274,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);
    }
  }