AudioFlinger: Fix spurious underrun logging
Removes false positive errors in metrics and debugging.
Test: Play Music, check underruns
Bug: 159620406
Change-Id: I008381bbf3aae13c0fe8289a0eeec47b7780e587
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index be2f687..126015f 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -805,7 +805,7 @@
status_t status = mServerProxy->obtainBuffer(&buf);
buffer->frameCount = buf.mFrameCount;
buffer->raw = buf.mRaw;
- if (buf.mFrameCount == 0 && !isStopping() && !isStopped() && !isPaused()) {
+ if (buf.mFrameCount == 0 && !isStopping() && !isStopped() && !isPaused() && !isOffloaded()) {
ALOGV("%s(%d): underrun, framesReady(%zu) < framesDesired(%zd), state: %d",
__func__, mId, buf.mFrameCount, desiredFrames, mState);
mAudioTrackServerProxy->tallyUnderrunFrames(desiredFrames);