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

Commit 3cbd62c3 authored by Kenny Root's avatar Kenny Root
Browse files

Store AudioTrack return value for error condition

Store AudioTrack->initCheck()'s return value so we can return it after
the AudioTrack is deleted.

Change-Id: Ie042a7d6a54d7f9afd8a5767cfd167dbeb2e5c04
parent c948cc8c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -99,13 +99,13 @@ status_t AudioPlayer::start() {
                    : AudioSystem::CHANNEL_OUT_MONO,
                8192, 0, &AudioCallback, this, 0);

        if (mAudioTrack->initCheck() != OK) {
        if ((err = mAudioTrack->initCheck()) != OK) {
            delete mAudioTrack;
            mAudioTrack = NULL;

            mSource->stop();

            return mAudioTrack->initCheck();
            return err;
        }

        mLatencyUs = (int64_t)mAudioTrack->latency() * 1000;