AudioFlinger: fix timed audio
(cherry picked from commit e20ac92c564a2f4e8123885807abdf0a78de0dd7)
> AudioFlinger: fix timed audio
>
> Addresses Bug 6900517.
>
> Finish up support for timed audio in the new FastMixer world. Pay special
> attention to remaining lock-less and voluntary yield free on the FastMixer
> thread. This fixes audio playback for Q on JB.
>
> Change-Id: Iaf815e58a1b1d0a0190051794bec8dc5c9231785
> Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I9bd687acc345a05867af48e71116690fdb0ce1b5
Signed-off-by: John Grossman <johngro@google.com>
diff --git a/services/audioflinger/AudioStreamOutSink.cpp b/services/audioflinger/AudioStreamOutSink.cpp
index 8a5aa0c..bc2d15b 100644
--- a/services/audioflinger/AudioStreamOutSink.cpp
+++ b/services/audioflinger/AudioStreamOutSink.cpp
@@ -67,4 +67,16 @@
return ret;
}
+status_t AudioStreamOutSink::getNextWriteTimestamp(int64_t *timestamp) {
+ ALOG_ASSERT(timestamp != NULL);
+
+ if (NULL == mStream)
+ return INVALID_OPERATION;
+
+ if (NULL == mStream->get_next_write_timestamp)
+ return INVALID_OPERATION;
+
+ return mStream->get_next_write_timestamp(mStream, timestamp);
+}
+
} // namespace android