diff options
author | Leena Winterrowd <lenhardw@codeaurora.org> | 2015-12-11 17:06:13 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-23 14:28:26 -0800 |
commit | 0c04699de90c89a00eb39256b60f59723f323d05 (patch) | |
tree | db4e8b8b255fdf815416958a8dd0ac0928c8f2d6 /media/libmedia | |
parent | de3b1c01146d2103f6bf56e2659a9c650734945a (diff) | |
download | frameworks_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.cpp | 2 |
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; } |