Merge "AudioFlinger: Fix spurious underrun logging" into rvc-dev am: 54cc1e3c43

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

Change-Id: I8936e5fb2cbab3a81acc390067938c728fed9974
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);