am 3c78a1b5: Return a runtime error instead of asserting if the AACDecoder is passed an unsupported config.

Merge commit '3c78a1b58957e31d2991fb6a609abecbb1987b3b' into froyo-plus-aosp

* commit '3c78a1b58957e31d2991fb6a609abecbb1987b3b':
  Return a runtime error instead of asserting if the AACDecoder is passed an unsupported config.
This commit is contained in:
Andreas Huber
2010-05-13 11:16:43 -07:00
committed by Android Git Automerger
2 changed files with 10 additions and 3 deletions

View 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)) { } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_QCELP)) {
// For legacy reasons we're simply going to ignore the absence // For legacy reasons we're simply going to ignore the absence
// of an audio decoder for QCELP instead of aborting playback // of an audio decoder for QCELP instead of aborting playback

View File

@@ -90,8 +90,10 @@ status_t AACDecoder::start(MetaData *params) {
mConfig->pOutputBuffer_plus = NULL; mConfig->pOutputBuffer_plus = NULL;
mConfig->repositionFlag = false; mConfig->repositionFlag = false;
CHECK_EQ(PVMP4AudioDecoderConfig(mConfig, mDecoderBuf), if (PVMP4AudioDecoderConfig(mConfig, mDecoderBuf)
MP4AUDEC_SUCCESS); != MP4AUDEC_SUCCESS) {
return ERROR_UNSUPPORTED;
}
} }
mSource->start(); mSource->start();