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

Unified Diff: content/renderer/media/renderer_webaudiodevice_impl.cc

Issue 2908073002: Make OS audio buffer size limits visible. (Closed)
Patch Set: Created 3 years, 7 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 | content/shell/renderer/layout_test/layout_test_content_renderer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/renderer_webaudiodevice_impl.cc
diff --git a/content/renderer/media/renderer_webaudiodevice_impl.cc b/content/renderer/media/renderer_webaudiodevice_impl.cc
index ef941bec24e00b4c414f38abd6562ecf39c08ba3..31173babc9f55cdfadf004a098af9c97a800f1f1 100644
--- a/content/renderer/media/renderer_webaudiodevice_impl.cc
+++ b/content/renderer/media/renderer_webaudiodevice_impl.cc
@@ -16,6 +16,7 @@
#include "content/renderer/media/audio_device_factory.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_thread_impl.h"
+#include "media/audio/audio_manager.h"
#include "media/base/audio_timestamp_helper.h"
#include "media/base/silent_sink_suspender.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
@@ -65,12 +66,13 @@ int GetOutputBufferSize(const blink::WebAudioLatencyHint& latency_hint,
hardware_params.sample_rate(), 0);
break;
case media::AudioLatency::LATENCY_EXACT_MS:
- // TODO(andrew.macpherson@soundtrap.com): http://crbug.com/708917
- return std::min(4096,
+ return std::min(media::AudioManager::GetMaximumAudioBufferSize(
o1ka 2017/05/29 16:11:33 AudioManager is browser side only entity and canno
+ hardware_params.sample_rate()),
media::AudioLatency::GetExactBufferSize(
base::TimeDelta::FromSecondsD(latency_hint.Seconds()),
hardware_params.sample_rate(),
- hardware_params.frames_per_buffer()));
+ media::AudioManager::GetMinimumAudioBufferSize(
+ hardware_params.sample_rate())));
break;
default:
NOTREACHED();
« no previous file with comments | « no previous file | content/shell/renderer/layout_test/layout_test_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698