From 4471e47ece77be5b4159cc9cbbcef4d43900d36f Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 14 Nov 2012 09:06:33 -0800 Subject: Properly signal an error if codec configuration goes wrong. previously any error signaled by setupXXX inside ACodec::configureCodec would be overwritten with the result of setMinBufferSize at the end of the function. Change-Id: Id4beb571ca52ea4646239d0af006e09ce1130268 related-to-bug: 7542181 --- media/libstagefright/ACodec.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 0ca027b..84b4962 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -937,7 +937,8 @@ status_t ACodec::configureCodec( } err = setupAACCodec( - encoder, numChannels, sampleRate, bitRate, aacProfile, isADTS != 0); + encoder, numChannels, sampleRate, bitRate, aacProfile, + isADTS != 0); } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AMR_NB)) { err = setupAMRCodec(encoder, false /* isWAMR */, bitRate); @@ -986,6 +987,10 @@ status_t ACodec::configureCodec( } } + if (err != OK) { + return err; + } + if (!msg->findInt32("encoder-delay", &mEncoderDelay)) { mEncoderDelay = 0; } -- cgit v1.1