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

Commit 807baf46 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "av: Support restore track for offload/direct track" into main

parents 91e28a3e 7b69bd4e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1707,14 +1707,14 @@ status_t AudioTrack::setOutputDevice(audio_port_handle_t deviceId) {
        mSelectedDeviceId = deviceId;
        if (mStatus == NO_ERROR) {
            if (isOffloadedOrDirect_l()) {
                if (mState == STATE_STOPPED || mState == STATE_FLUSHED) {
                    ALOGD("%s(%d): creating a new AudioTrack", __func__, mPortId);
                    result = restoreTrack_l("setOutputDevice", true /* forceRestore */);
                } else {
                if (isPlaying_l()) {
                    ALOGW("%s(%d). Offloaded or Direct track is not STOPPED or FLUSHED. "
                          "State: %s.",
                            __func__, mPortId, stateToString(mState));
                    result = INVALID_OPERATION;
                } else {
                    ALOGD("%s(%d): creating a new AudioTrack", __func__, mPortId);
                    result = restoreTrack_l("setOutputDevice", true /* forceRestore */);
                }
            } else {
                // allow track invalidation when track is not playing to propagate