Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: media/audio/android/audio_manager_android.cc

Issue 2795743003: Enable high latency audio on Android N+ for basic playback.
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/audio/android/opensles_output.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/android/audio_manager_android.cc
diff --git a/media/audio/android/audio_manager_android.cc b/media/audio/android/audio_manager_android.cc
index 502a8cbf8dc84955a99546cfabc3858b164e0e4e..366c97d819f5e128eb16065bde0304a8bc7a9113 100644
--- a/media/audio/android/audio_manager_android.cc
+++ b/media/audio/android/audio_manager_android.cc
@@ -332,8 +332,13 @@ AudioParameters AudioManagerAndroid::GetPreferredOutputStreamParameters(
channel_layout = input_params.channel_layout();
}
- buffer_size = GetOptimalOutputFrameSize(
- sample_rate, ChannelLayoutToChannelCount(channel_layout));
+ // For high latency playback, pass through the requested buffer size.
+ if (input_params.latency_tag() == AudioLatency::LATENCY_PLAYBACK) {
+ buffer_size = input_params.frames_per_buffer();
+ } else {
+ buffer_size = GetOptimalOutputFrameSize(
+ sample_rate, ChannelLayoutToChannelCount(channel_layout));
+ }
}
int user_buffer_size = GetUserBufferSize();
« no previous file with comments | « no previous file | media/audio/android/opensles_output.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698