diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2012-10-16 11:27:24 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-16 11:27:25 -0700 |
commit | 9bccfb551d79a16e23278db7b0e043da79118bf8 (patch) | |
tree | 6300723d5c78a5f9e0e91bf5436cbe7c2f97b818 | |
parent | fbd60660780839a15db9f1c78c5feecd6ba6ed09 (diff) | |
parent | 115b87ecf6182698b54055288d0f8710308b324d (diff) | |
download | frameworks_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.cpp | 6 |
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)) { |