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

Commit 6a4076ca 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 am: 58aa0a29

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

Change-Id: Ic225a5b6db5fb85a9211103e363b26e011d44d46
parents e9aa8459 58aa0a29
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;
                }
            }
        }