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

Commit 022048e9 authored by James Dong's avatar James Dong
Browse files

Stop audio source if AudioPlayer could not be started

related-to-bug: 6500580

Change-Id: If47e442db2f1ea400e9b598502bb48513f28cd6d
parent 88ba895b
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -142,9 +142,10 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
                mFirstBuffer = NULL;
            }

            if (!sourceAlreadyStarted) {
            // At this point, source already got started
            // Stop the source when error is found.
            mSource->stop();
            }
            mSource = NULL;

            return err;
        }
@@ -174,9 +175,9 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
                mFirstBuffer = NULL;
            }

            if (!sourceAlreadyStarted) {
            // At this point, source already got started
            // Stop the source when error is found.
            mSource->stop();
            }

            return err;
        }