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

Commit bd1850f2 authored by Pavan Chikkala's avatar Pavan Chikkala Committed by Steve Kondik
Browse files

audio: Handled openOutput error for Tunnel/LPA Usecase

- When openOutput is failed for Tunnel/LPA use case,
  mDirectTracks does not contain AudioSessionDescriptor
  for the given output and is leading to a crash
- Added NULL check to avoid the crash

CRs-Fixed: 791143

Change-Id: I0c09fa1df80b9240de6ab6de3f72419f78846a5c
parent 0d5c409e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2161,8 +2161,12 @@ status_t AudioFlinger::openOutput(audio_module_handle_t module,
          *latencyMs = 0;
          if ((flags & AUDIO_OUTPUT_FLAG_LPA) || (flags & AUDIO_OUTPUT_FLAG_TUNNEL)) {
              AudioSessionDescriptor *desc = mDirectAudioTracks.valueFor(*output);
              if(desc != NULL) {
                 *latencyMs = desc->stream->get_latency(desc->stream);
                 return NO_ERROR;
              } else {
                 return NO_INIT;
              }
          }
#endif
    }