AudioTrack: Control deep buffer from AudioAttributes
Test: AudioTrack CTS test, Play Movies
Bug: 30687201
Change-Id: I6a46a05dbf3fd61c8d47dade5b4baee69b923195
diff --git a/media/libaudioclient/AudioTrack.cpp b/media/libaudioclient/AudioTrack.cpp
index f9ab208..0de3559 100644
--- a/media/libaudioclient/AudioTrack.cpp
+++ b/media/libaudioclient/AudioTrack.cpp
@@ -383,6 +383,10 @@
if ((mAttributes.flags & AUDIO_FLAG_LOW_LATENCY) != 0) {
flags = (audio_output_flags_t) (flags | AUDIO_OUTPUT_FLAG_FAST);
}
+ // check deep buffer after flags have been modified above
+ if (flags == AUDIO_OUTPUT_FLAG_NONE && (mAttributes.flags & AUDIO_FLAG_DEEP_BUFFER) != 0) {
+ flags = AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
+ }
}
// these below should probably come from the audioFlinger too...