diff options
author | Andreas Huber <andih@google.com> | 2010-05-13 09:15:21 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-05-13 09:19:35 -0700 |
commit | 3c78a1b58957e31d2991fb6a609abecbb1987b3b (patch) | |
tree | bb88120232e7466b6ee121a9b8a40b5deff52c6b /media | |
parent | 8ea9f130d24a7dd1e505ba0cf437bdd8a660975e (diff) | |
download | frameworks_base-3c78a1b58957e31d2991fb6a609abecbb1987b3b.zip frameworks_base-3c78a1b58957e31d2991fb6a609abecbb1987b3b.tar.gz frameworks_base-3c78a1b58957e31d2991fb6a609abecbb1987b3b.tar.bz2 |
Return a runtime error instead of asserting if the AACDecoder is passed an unsupported config.
Change-Id: Ie084ed4df5a5d286abd36d9149c2138f8e7ed08a
related-to-bug: 2682221
QA-impact: none
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 7 | ||||
-rw-r--r-- | media/libstagefright/codecs/aacdec/AACDecoder.cpp | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 475160e..f668caa 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -778,7 +778,12 @@ status_t AwesomePlayer::initAudioDecoder() { } } - mAudioSource->start(); + status_t err = mAudioSource->start(); + + if (err != OK) { + mAudioSource.clear(); + return err; + } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_QCELP)) { // For legacy reasons we're simply going to ignore the absence // of an audio decoder for QCELP instead of aborting playback diff --git a/media/libstagefright/codecs/aacdec/AACDecoder.cpp b/media/libstagefright/codecs/aacdec/AACDecoder.cpp index ae23691..2bc4448 100644 --- a/media/libstagefright/codecs/aacdec/AACDecoder.cpp +++ b/media/libstagefright/codecs/aacdec/AACDecoder.cpp @@ -90,8 +90,10 @@ status_t AACDecoder::start(MetaData *params) { mConfig->pOutputBuffer_plus = NULL; mConfig->repositionFlag = false; - CHECK_EQ(PVMP4AudioDecoderConfig(mConfig, mDecoderBuf), - MP4AUDEC_SUCCESS); + if (PVMP4AudioDecoderConfig(mConfig, mDecoderBuf) + != MP4AUDEC_SUCCESS) { + return ERROR_UNSUPPORTED; + } } mSource->start(); |