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

Commit e112faf9 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix buzz sound when one earbud connected

Move in buffer pointer initialization before the loop.

Bug: 232738066
Test: Hear audio on single device
Change-Id: Ie0eb5815ff9459316d4f7351caf349139a9eef0f
parent d4fb5c4f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1997,8 +1997,8 @@ class LeAudioClientImpl : public LeAudioClient {

    if (bytes_per_sample == 2) {
      int16_t* out = (int16_t*)mono_out.data();
      for (size_t i = 0; i < frames; ++i) {
      const int16_t* in = (int16_t*)(buf.data());
      for (size_t i = 0; i < frames; ++i) {
        int accum = 0;
        accum += *in++;
        accum += *in++;
@@ -2007,8 +2007,8 @@ class LeAudioClientImpl : public LeAudioClient {
      }
    } else if (bytes_per_sample == 4) {
      int32_t* out = (int32_t*)mono_out.data();
      for (size_t i = 0; i < frames; ++i) {
      const int32_t* in = (int32_t*)(buf.data());
      for (size_t i = 0; i < frames; ++i) {
        int accum = 0;
        accum += *in++;
        accum += *in++;