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

Commit c7a16a41 authored by Amit Shekhar's avatar Amit Shekhar Committed by Linux Build Service Account
Browse files

frameworks/av: Fix format for 8_24 bit pcm

Set format to AUDIO_FORMAT_PCM_8_24_BIT only when
audio.offload.pcm.enable is enabled, bit width is 24 and
mOffloadAudio is true.

Change-Id: I6b36c7f2d3339de068723aa65bda419917defcb7
CRs-Fixed: 734800
parent 2f791f54
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1713,7 +1713,11 @@ status_t AwesomePlayer::initAudioDecoder() {
            sp<MetaData> format = mAudioSource->getFormat();
            int bitWidth = 16;
            format->findInt32(kKeySampleBits, &bitWidth);
            if (24 == bitWidth)
            char prop_pcmoffload[PROPERTY_VALUE_MAX] = {0};
            property_get("audio.offload.pcm.enable", prop_pcmoffload, "0");
            if ((mOffloadAudio) &&
                (24 == bitWidth) &&
                (!strcmp(prop_pcmoffload, "true") || atoi(prop_pcmoffload)))
                tempMetadata->setInt32(kKeyPcmFormat, AUDIO_FORMAT_PCM_8_24_BIT);
        }
        err = mAudioSource->start(tempMetadata.get());