diff options
author | Glenn Kasten <gkasten@google.com> | 2013-08-23 13:51:43 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-09-03 11:24:02 -0700 |
commit | 767094dd98b01baf21de2ad09c27b3c98776cf73 (patch) | |
tree | 57b1a9c3b3d794bac2e1922b314046f02df18e7e /services | |
parent | e45a767e13fe3396185c9d378a70f7f11eb881d0 (diff) | |
download | frameworks_av-767094dd98b01baf21de2ad09c27b3c98776cf73.zip frameworks_av-767094dd98b01baf21de2ad09c27b3c98776cf73.tar.gz frameworks_av-767094dd98b01baf21de2ad09c27b3c98776cf73.tar.bz2 |
Add NBAIO_Sink::getTimestamp()
with a real implementation in AudioStreamOutSink
for dummy implementation initially in MonoPipe.
Use in AudioFlinger::PlaybackThread::threadLoop_write()
to keep the input to the timestamp latch up-to-date.
Change-Id: I10ef277991b63bb43d55d6f3df75116ef32246cd
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/Threads.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 3921b68..fda4211 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -1820,7 +1820,7 @@ ssize_t AudioFlinger::PlaybackThread::threadLoop_write() } else { bytesWritten = framesWritten; } - status_t status = INVALID_OPERATION; // mLatchD.mTimestamp is invalid + status_t status = mNormalSink->getTimestamp(mLatchD.mTimestamp); if (status == NO_ERROR) { size_t totalFramesWritten = mNormalSink->framesWritten(); if (totalFramesWritten >= mLatchD.mTimestamp.mPosition) { @@ -1837,6 +1837,8 @@ ssize_t AudioFlinger::PlaybackThread::threadLoop_write() ALOG_ASSERT(mCallbackThread != 0); mCallbackThread->setWriteBlocked(true); } + // FIXME We should have an implementation of timestamps for direct output threads. + // They are used e.g for multichannel PCM playback over HDMI. bytesWritten = mOutput->stream->write(mOutput->stream, mMixBuffer + offset, mBytesRemaining); if (mUseAsyncWrite && |