diff options
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 15 | ||||
-rw-r--r-- | media/libstagefright/include/AwesomePlayer.h | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 77c25d1..788464e 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -890,7 +890,11 @@ status_t AwesomePlayer::play_l() { CHECK(!(mFlags & AUDIO_RUNNING)); if (mVideoSource == NULL) { - status_t err = startAudioPlayer_l(); + // We don't want to post an error notification at this point, + // the error returned from MediaPlayer::start() will suffice. + + status_t err = startAudioPlayer_l( + false /* sendErrorNotification */); if (err != OK) { delete mAudioPlayer; @@ -940,7 +944,7 @@ status_t AwesomePlayer::play_l() { return OK; } -status_t AwesomePlayer::startAudioPlayer_l() { +status_t AwesomePlayer::startAudioPlayer_l(bool sendErrorNotification) { CHECK(!(mFlags & AUDIO_RUNNING)); if (mAudioSource == NULL || mAudioPlayer == NULL) { @@ -958,7 +962,10 @@ status_t AwesomePlayer::startAudioPlayer_l() { true /* sourceAlreadyStarted */); if (err != OK) { - notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, err); + if (sendErrorNotification) { + notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, err); + } + return err; } @@ -1684,7 +1691,7 @@ void AwesomePlayer::onVideoEvent() { if (mAudioPlayer != NULL && !(mFlags & (AUDIO_RUNNING | SEEK_PREVIEW))) { status_t err = startAudioPlayer_l(); if (err != OK) { - LOGE("Startung the audio player failed w/ err %d", err); + LOGE("Starting the audio player failed w/ err %d", err); return; } } diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h index e069b4d..95f2ae8 100644 --- a/media/libstagefright/include/AwesomePlayer.h +++ b/media/libstagefright/include/AwesomePlayer.h @@ -291,7 +291,7 @@ private: void finishSeekIfNecessary(int64_t videoTimeUs); void ensureCacheIsFetching_l(); - status_t startAudioPlayer_l(); + status_t startAudioPlayer_l(bool sendErrorNotification = true); void postAudioSeekComplete_l(); void shutdownVideoDecoder_l(); |