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

Commit 5fb03b87 authored by Andreas Huber's avatar Andreas Huber
Browse files

After failing to create an AudioTrack, only stop the source if we were the ones starting it.

Change-Id: I1820c2634cfeb01af9eaf11b6473c5d7b87d1fa3
related-to-bug: 2716035
parent a581a776
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -87,7 +87,9 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
                DEFAULT_AUDIOSINK_BUFFERCOUNT,
                &AudioPlayer::AudioSinkCallback, this);
        if (err != OK) {
            if (!sourceAlreadyStarted) {
                mSource->stop();
            }

            return err;
        }
@@ -108,7 +110,9 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
            delete mAudioTrack;
            mAudioTrack = NULL;

            if (!sourceAlreadyStarted) {
                mSource->stop();
            }

            return err;
        }