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

Commit 15659961 authored by Ramjee Singh's avatar Ramjee Singh Committed by Gerrit Code Review
Browse files

audio: Initialized mAttributes in AudioTrack

- DirectAudioTrack creation fails for LPA/Tunnel playback
  if pAttributes passed to constructor is NULL. The reason is
  if pAttributes is NULL mAttributes is not initialized.
  getOutputForAttributes reads random usage value due to
  this reason
- Fix is to initialise mAttributes to default value.

CRs-Fixed: 811692
Change-Id: I0e747c6b46215a9b52e9d489c292b1046bd08f97
parent c16c177d
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -160,6 +160,12 @@ AudioTrack::AudioTrack(
#endif

{
#ifdef QCOM_DIRECTTRACK
    mAttributes.content_type = AUDIO_CONTENT_TYPE_UNKNOWN;
    mAttributes.usage = AUDIO_USAGE_UNKNOWN;
    mAttributes.flags = 0x0;
    strcpy(mAttributes.tags, "");
#endif
    mStatus = set(streamType, sampleRate, format, channelMask,
            frameCount, flags, cbf, user, notificationFrames,
            0 /*sharedBuffer*/, false /*threadCanCallJava*/, sessionId, transferType,
@@ -195,6 +201,12 @@ AudioTrack::AudioTrack(
      mPausedPosition(0)
#endif
{
#ifdef QCOM_DIRECTTRACK
    mAttributes.content_type = AUDIO_CONTENT_TYPE_UNKNOWN;
    mAttributes.usage = AUDIO_USAGE_UNKNOWN;
    mAttributes.flags = 0x0;
    strcpy(mAttributes.tags, "");
#endif
    mStatus = set(streamType, sampleRate, format, channelMask,
            0 /*frameCount*/, flags, cbf, user, notificationFrames,
            sharedBuffer, false /*threadCanCallJava*/, sessionId, transferType, offloadInfo,