summaryrefslogtreecommitdiffstats
path: root/services
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
commitbbe11e46faf8f9e3296431993c36d3efc61337b5 (patch)
treee33c61028c78cd699a81c14fdda65e60dc7a8fd3 /services
parent547173205b3fd909dd72b597f6372840c38460e4 (diff)
parenta045dcafd2b77036210f5b72e79d745ad4c1b848 (diff)
downloadframeworks_av-bbe11e46faf8f9e3296431993c36d3efc61337b5.zip
frameworks_av-bbe11e46faf8f9e3296431993c36d3efc61337b5.tar.gz
frameworks_av-bbe11e46faf8f9e3296431993c36d3efc61337b5.tar.bz2
Merge "Fix track estimation for presentation complete" into jb-mr1-dev
Diffstat (limited to 'services')
-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)) {