From 90eea7631b07117e46ae8b84889a2baa3eee7aea Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Mon, 6 Jul 2015 16:24:14 -0700 Subject: AudioFlinger: reset frame position on standby The HAL does not reset the frame position on standby(). But applications expect the frame position to be reset. So we subtract the position at standby from the current position. Bug: 21724210 Bug: 21930805 Change-Id: I0c4520ba1c6c06a580f45f6bafc8cf1d56969f07 Signed-off-by: Phil Burk --- services/audioflinger/AudioStreamOut.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'services/audioflinger/AudioStreamOut.h') diff --git a/services/audioflinger/AudioStreamOut.h b/services/audioflinger/AudioStreamOut.h index e91ca9c..761e771 100644 --- a/services/audioflinger/AudioStreamOut.h +++ b/services/audioflinger/AudioStreamOut.h @@ -53,7 +53,10 @@ public: virtual ~AudioStreamOut() { } - virtual status_t getRenderPosition(uint32_t *frames); + // Get the bottom 32-bits of the 64-bit render position. + status_t getRenderPosition(uint32_t *frames); + + virtual status_t getRenderPosition(uint64_t *frames); virtual status_t getPresentationPosition(uint64_t *frames, struct timespec *timestamp); @@ -76,6 +79,14 @@ public: virtual status_t flush(); virtual status_t standby(); + +protected: + uint64_t mFramesWritten; // reset by flush + uint64_t mFramesWrittenAtStandby; + uint64_t mRenderPosition; // reset by flush or standby + int mRateMultiplier; + bool mHalFormatIsLinearPcm; + size_t mHalFrameSize; }; } // namespace android -- cgit v1.1