diff options
author | Eric Laurent <elaurent@google.com> | 2013-08-29 14:35:05 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-08-29 14:35:05 -0700 |
commit | 42a6f422c09ca6a960673e0e805ddf71a9b51bef (patch) | |
tree | 7c38dd1f569bd9546f5cef3c5f58ff6ca35cbeff | |
parent | bdd467edb8550ab006c89a59b556759386e99898 (diff) | |
download | frameworks_av-42a6f422c09ca6a960673e0e805ddf71a9b51bef.zip frameworks_av-42a6f422c09ca6a960673e0e805ddf71a9b51bef.tar.gz frameworks_av-42a6f422c09ca6a960673e0e805ddf71a9b51bef.tar.bz2 |
AudioTrack: fix write retries for compressed audio
When the amount of frames that can be written to the buffer
is less than requested, AudioTrack::processAudioBuffer() estimates
the time needed to free the missing amount of frames and asks the
callback thread to sleep.
This behavior is not possible for compressed audio and should not
be enabled for offloaded tracks.
Change-Id: I5b657283cfba06254c9ac0ea9b447467cce7eb61
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 214e789..7aa9e35 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1550,7 +1550,7 @@ nsecs_t AudioTrack::processAudioBuffer(const sp<AudioTrackThread>& thread) return NS_NEVER; } - if (mRetryOnPartialBuffer) { + if (mRetryOnPartialBuffer && !isOffloaded()) { mRetryOnPartialBuffer = false; if (avail < mRemainingFrames) { int64_t myns = ((mRemainingFrames - avail) * 1100000000LL) / sampleRate; |