summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorLeena Winterrowd <lenhardw@codeaurora.org>2015-12-11 17:06:13 -0800
committerSteve Kondik <steve@cyngn.com>2015-12-23 14:28:26 -0800
commit0c04699de90c89a00eb39256b60f59723f323d05 (patch)
treedb4e8b8b255fdf815416958a8dd0ac0928c8f2d6 /media/libmedia
parentde3b1c01146d2103f6bf56e2659a9c650734945a (diff)
downloadframeworks_av-0c04699de90c89a00eb39256b60f59723f323d05.zip
frameworks_av-0c04699de90c89a00eb39256b60f59723f323d05.tar.gz
frameworks_av-0c04699de90c89a00eb39256b60f59723f323d05.tar.bz2
AudioTrack: Set DIRECT track flag for direct pcm output
While direct output should ideally be abstracted from the AudioTrack, the use of an offload path can leave data stuck in the shared buffer (especially if the clip is short such that the buffer is never entirely filled). To ensure that all data is played out on track stop(), AudioTrack must be aware of the direct output or offload session. Set the DIRECT track flag for track offload use cases to avoid losing data in the shared buffer. CRs-Fixed: 944878 Change-Id: I13f840b5d67be56e03ec65d3bc7d44f1090b48c5
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioTrack.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index ff57b44..d7256f8 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -1297,7 +1297,7 @@ status_t AudioTrack::createTrack_l()
trackFlags |= IAudioFlinger::TRACK_OFFLOAD;
}
- if (mFlags & AUDIO_OUTPUT_FLAG_DIRECT) {
+ if ((mFlags & AUDIO_OUTPUT_FLAG_DIRECT) || mTrackOffloaded) {
trackFlags |= IAudioFlinger::TRACK_DIRECT;
}