summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-10-16 11:27:24 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-16 11:27:25 -0700
commit9bccfb551d79a16e23278db7b0e043da79118bf8 (patch)
tree6300723d5c78a5f9e0e91bf5436cbe7c2f97b818
parentfbd60660780839a15db9f1c78c5feecd6ba6ed09 (diff)
parent115b87ecf6182698b54055288d0f8710308b324d (diff)
downloadframeworks_av-9bccfb551d79a16e23278db7b0e043da79118bf8.zip
frameworks_av-9bccfb551d79a16e23278db7b0e043da79118bf8.tar.gz
frameworks_av-9bccfb551d79a16e23278db7b0e043da79118bf8.tar.bz2
Merge "Fix track estimation for presentation complete" into jb-mr1-dev
-rw-r--r--services/audioflinger/AudioFlinger.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index aa30864..6a35053 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -3275,8 +3275,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
// Remove it from the list of active tracks.
// TODO: use actual buffer filling status instead of latency when available from
// audio HAL
- size_t audioHALFrames =
- (mOutput->stream->get_latency(mOutput->stream)*mSampleRate) / 1000;
+ size_t audioHALFrames = (latency_l() * mSampleRate) / 1000;
size_t framesWritten =
mBytesWritten / audio_stream_frame_size(&mOutput->stream->common);
if (track->presentationComplete(framesWritten, audioHALFrames)) {
@@ -3799,8 +3798,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep
// We have consumed all the buffers of this track.
// Remove it from the list of active tracks.
// TODO: implement behavior for compressed audio
- size_t audioHALFrames =
- (mOutput->stream->get_latency(mOutput->stream)*mSampleRate) / 1000;
+ size_t audioHALFrames = (latency_l() * mSampleRate) / 1000;
size_t framesWritten =
mBytesWritten / audio_stream_frame_size(&mOutput->stream->common);
if (track->presentationComplete(framesWritten, audioHALFrames)) {