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

Commit 58aa0a29 authored by Haynes Mathew George's avatar Haynes Mathew George Committed by Automerger Merge Worker
Browse files

audioflinger: pause direct output when buffer timeout am: 82fa4811

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1690347

Change-Id: I5b869ac44b5c6e6b9279de44efff9b57364be474
parents 16334036 82fa4811
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -5961,15 +5961,17 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep
                    // indicate to client process that the track was disabled because of underrun;
                    // it will then automatically call start() when data is available
                    track->disable();
                } else if (last) {
                    // only do hw pause when track is going to be removed due to BUFFER TIMEOUT.
                    // unlike mixerthread, HAL can be paused for direct output
                    ALOGW("pause because of UNDERRUN, framesReady = %zu,"
                            "minFrames = %u, mFormat = %#x",
                            framesReady, minFrames, mFormat);
                    mixerStatus = MIXER_TRACKS_ENABLED;
                    if (mHwSupportsPause && !mHwPaused && !mStandby) {
                    if (last && mHwSupportsPause && !mHwPaused && !mStandby) {
                        doHwPause = true;
                        mHwPaused = true;
                    }
                } else if (last) {
                    mixerStatus = MIXER_TRACKS_ENABLED;
                }
            }
        }