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

Commit 2b409cfe authored by Jakub Tyszkowski's avatar Jakub Tyszkowski Committed by Łukasz Rymanowski
Browse files

LeAudio: Fix not releasing the codec resources

After stream gets suspended and the active group goes to IDLE state, we
should be cleaning up the codec. It gets created when the stream is
resumed.

Bug: 295972694
Bug: 262481440
Test: manually - start, stop stream and wait, then resume and observe no warning about the encoder instance not being destroyed
Change-Id: I781e603e0453984841821197c139f2b8927173bf
parent cff48f93
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -5169,6 +5169,12 @@ class LeAudioClientImpl : public LeAudioClient {
         */
         */
        FALLTHROUGH;
        FALLTHROUGH;
      case GroupStreamStatus::IDLE: {
      case GroupStreamStatus::IDLE: {
        if (sw_enc_left) sw_enc_left.reset();
        if (sw_enc_right) sw_enc_right.reset();
        if (sw_dec_left) sw_dec_left.reset();
        if (sw_dec_right) sw_dec_right.reset();
        CleanCachedMicrophoneData();

        if (group) {
        if (group) {
          UpdateLocationsAndContextsAvailability(group->group_id_);
          UpdateLocationsAndContextsAvailability(group->group_id_);
          if (group->IsPendingConfiguration()) {
          if (group->IsPendingConfiguration()) {