summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-11-14 09:06:33 -0800
committerAndreas Huber <andih@google.com>2012-11-14 09:06:33 -0800
commit4471e47ece77be5b4159cc9cbbcef4d43900d36f (patch)
tree66c57d19a0acf3ec490a924077e9200cbfbdac29
parent78b012f5bc05706d1ce412811ccfaa9385dae0ab (diff)
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
-rw-r--r--media/libstagefright/ACodec.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 0ca027b5..84b4962f 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;
}