AudioTrack: Add getUnderrunCount()
This allows an app to detect application-level output glitches.
Underrun counts survive track recreation.
Change-Id: I8eb14e92f6fc1007718a29b0666ab51ace30cdb8
Bug: 25641253
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index b1638ea..c753afd 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -600,7 +600,10 @@
buffer->raw = buf.mRaw;
if (buf.mFrameCount == 0) {
mAudioTrackServerProxy->tallyUnderrunFrames(desiredFrames);
+ } else {
+ mAudioTrackServerProxy->tallyUnderrunFrames(0);
}
+
return status;
}