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

Commit 47cc724e authored by Zhou Song's avatar Zhou Song Committed by Linux Build Service Account
Browse files

libstagefright: stop audio source before deleting AudioPlayer

-audio source won't be stopped during AudioPlayer destruction
 due to start failed and AUDIOPLAYER_STARTED not set
-handle audio source stop in AwesomePlayer if AUDIOPLAYER_STARTED
 not set

Change-Id: I395c045a0a8a5d5b6ea8cc762d6a2636bb885b0e
CRs-Fixed: 704605
parent 45bc3cb9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1022,6 +1022,10 @@ status_t AwesomePlayer::play_l() {
            }

            if (err != OK) {
                if ((mAudioPlayer == NULL || !(mFlags & AUDIOPLAYER_STARTED))
                        && mAudioSource != NULL) {
                    mAudioSource->stop();
                }
                mAudioSource.clear();
                mOmxSource.clear();

@@ -1989,6 +1993,10 @@ void AwesomePlayer::onVideoEvent() {
            ALOGE("Failed to fallback to SW decoder err = %d", err);
            notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, err);

            if ((mAudioPlayer == NULL || !(mFlags & AUDIOPLAYER_STARTED))
                    && mAudioSource != NULL) {
                mAudioSource->stop();
            }
            mAudioSource.clear();
            mOmxSource.clear();