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

Commit b3ce4482 authored by Jaideep Sharma's avatar Jaideep Sharma Committed by Eric Laurent
Browse files

libmedia: modify conditions to reuse track.

If recycled and new tracks are not on the same output, don't reuse the recycled one

Bug: 111196161
Test: manual audio smoke tests.

Change-Id: I36e012904bb45b71cf91509d108a89bb2822a020
parent c5634ebd
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -662,9 +662,7 @@ public:
     *  handle on audio hardware output, or AUDIO_IO_HANDLE_NONE if the
     *  track needed to be re-created but that failed
     */
private:
            audio_io_handle_t    getOutput() const;
public:

    /* Selects the audio device to use for output of this AudioTrack. A value of
     * AUDIO_PORT_HANDLE_NONE indicates default (AudioPolicyManager) routing.
+6 −0
Original line number Diff line number Diff line
@@ -2246,6 +2246,12 @@ status_t MediaPlayerService::AudioOutput::open(
                      mRecycledTrack->frameCount(), t->frameCount());
                reuse = false;
            }
            // If recycled and new tracks are not on the same output,
            // don't reuse the recycled one.
            if (mRecycledTrack->getOutput() != t->getOutput()) {
                ALOGV("output has changed, don't reuse track");
                reuse = false;
            }
        }

        if (reuse) {