diff options
author | Eric Laurent <elaurent@google.com> | 2012-04-13 16:50:19 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-04-20 14:17:02 -0700 |
commit | 1948eb3ea6eee336e8cdab9b0c693f93f5f19993 (patch) | |
tree | 448eed49a4ba18fb1ab4f2fb1b2c0d5cef6d242f /media/libmedia | |
parent | 21e8c50bd13ebe44f3088e26c9c6df0e163c469c (diff) | |
download | frameworks_av-1948eb3ea6eee336e8cdab9b0c693f93f5f19993.zip frameworks_av-1948eb3ea6eee336e8cdab9b0c693f93f5f19993.tar.gz frameworks_av-1948eb3ea6eee336e8cdab9b0c693f93f5f19993.tar.bz2 |
Add support for deep audio buffers
Allow AudioSink to use deep audio buffering when the
source is audio only and its duration is more than
a certain threshold.
This helps improve battery life but implies higher
audio latency.
Change-Id: Ie79915b61c370292f05aabda9779356570e03cbb
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 092b516..25d79d6 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -225,6 +225,10 @@ status_t AudioTrack::set( flags = (audio_output_flags_t) ((flags | AUDIO_OUTPUT_FLAG_DIRECT) & ~AUDIO_OUTPUT_FLAG_FAST); } + // only allow deep buffering for music stream type + if (streamType != AUDIO_STREAM_MUSIC) { + flags = (audio_output_flags_t)(flags &~AUDIO_OUTPUT_FLAG_DEEP_BUFFER); + } if (!audio_is_output_channel(channelMask)) { ALOGE("Invalid channel mask"); |