From ab35ee6f52fb9ad55f01eaf2dc745f7f00863d67 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Mon, 21 Dec 2015 05:13:15 -0500 Subject: stagefright: Deal with output format of other AAC decoders * Pass the bits-per-sample value when setting up the raw PCM output in case FFMPEG is decoding as it will produce floats. Change-Id: If5a8cc43a1c41e522324e77871823c9084f92169 --- media/libstagefright/ACodec.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'media/libstagefright/ACodec.cpp') diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index c84601d..6d26173 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -2065,6 +2065,7 @@ status_t ACodec::configureCodec( int32_t sbrMode; int32_t maxOutputChannelCount; int32_t pcmLimiterEnable; + int32_t bitsPerSample = 16; drcParams_t drc; if (!msg->findInt32("is-adts", &isADTS)) { isADTS = 0; @@ -2103,11 +2104,12 @@ status_t ACodec::configureCodec( // value is unknown drc.targetRefLevel = -1; } + msg->findInt32("bits-per-sample", &bitsPerSample); err = setupAACCodec( encoder, numChannels, sampleRate, bitRate, aacProfile, isADTS != 0, sbrMode, maxOutputChannelCount, drc, - pcmLimiterEnable); + pcmLimiterEnable, bitsPerSample); } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AMR_NB)) { err = setupAMRCodec(encoder, false /* isWAMR */, bitRate); @@ -2367,15 +2369,16 @@ status_t ACodec::setupAACCodec( bool encoder, int32_t numChannels, int32_t sampleRate, int32_t bitRate, int32_t aacProfile, bool isADTS, int32_t sbrMode, int32_t maxOutputChannelCount, const drcParams_t& drc, - int32_t pcmLimiterEnable) { + int32_t pcmLimiterEnable, int32_t bitsPerSample) { if (encoder && isADTS) { return -EINVAL; } - status_t err = setupRawAudioFormat( + status_t err = setupRawAudioFormatInternal( encoder ? kPortIndexInput : kPortIndexOutput, sampleRate, - numChannels); + numChannels, + bitsPerSample); if (err != OK) { return err; -- cgit v1.1