AudioFlinger: prevent retrograde timestamps for direct mode
Prevent retrograde motion in the HAL or drivers from making it
up through the AudioFlinger to the app.
Bug: 19604395
Change-Id: I11d6c0f7cab69e75fd4b4a2a90f64960b4bb6d5a
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/services/audioflinger/PlaybackTracks.h b/services/audioflinger/PlaybackTracks.h
index 902d5e4..45df6a9 100644
--- a/services/audioflinger/PlaybackTracks.h
+++ b/services/audioflinger/PlaybackTracks.h
@@ -157,8 +157,9 @@
bool mFlushHwPending; // track requests for thread flush
// for last call to getTimestamp
- bool mPreviousValid;
- uint32_t mPreviousFramesWritten;
+ bool mPreviousTimestampValid;
+ // This is either the first timestamp or one that has passed
+ // the check to prevent retrograde motion.
AudioTimestamp mPreviousTimestamp;
}; // end of Track