OSDN Git Service

Return a runtime error instead of asserting if the AACDecoder is passed an unsupporte...
authorAndreas Huber <andih@google.com>
Thu, 13 May 2010 16:15:21 +0000 (09:15 -0700)
committerAndreas Huber <andih@google.com>
Thu, 13 May 2010 16:19:35 +0000 (09:19 -0700)
Change-Id: Ie084ed4df5a5d286abd36d9149c2138f8e7ed08a
related-to-bug: 2682221
QA-impact: none

media/libstagefright/AwesomePlayer.cpp
media/libstagefright/codecs/aacdec/AACDecoder.cpp

index 475160e..f668caa 100644 (file)
@@ -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
index ae23691..2bc4448 100644 (file)
@@ -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();