Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1df573a authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "If audio startup fails while executing MediaPlayer::start() do NOT post an error"

parents 8cfe3d2d 232d5f2a
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -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) {
            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;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -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();