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

Unified Diff: content/browser/renderer_host/media/audio_renderer_host.cc

Issue 10832285: Switch OnMoreData() to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Comments. Created 8 years, 3 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/browser/renderer_host/media/audio_renderer_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc
index 4c1540e476c8fa10a9bc97bbe6e59cab1609c47b..8cd776b92742964c714ff75a99419346a019e6f7 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -13,6 +13,8 @@
#include "content/common/media/audio_messages.h"
#include "content/public/browser/media_observer.h"
#include "media/audio/shared_memory_util.h"
+#include "media/base/audio_bus.h"
+#include "media/base/limits.h"
using content::BrowserMessageFilter;
using content::BrowserThread;
@@ -197,9 +199,10 @@ void AudioRendererHost::OnCreateStream(
DCHECK(LookupById(stream_id) == NULL);
media::AudioParameters audio_params(params);
- DCHECK_GT(audio_params.frames_per_buffer(), 0);
-
- uint32 buffer_size = audio_params.GetBytesPerBuffer();
+ uint32 buffer_size = media::AudioBus::CalculateMemorySize(audio_params);
+ DCHECK_GT(buffer_size, 0U);
+ DCHECK_LE(buffer_size,
+ static_cast<uint32>(media::limits::kMaxPacketSizeInBytes));
scoped_ptr<AudioEntry> entry(new AudioEntry());
@@ -214,7 +217,7 @@ void AudioRendererHost::OnCreateStream(
// Create sync reader and try to initialize it.
scoped_ptr<AudioSyncReader> reader(
- new AudioSyncReader(&entry->shared_memory));
+ new AudioSyncReader(&entry->shared_memory, params));
if (!reader->Init()) {
SendErrorMessage(stream_id);
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_renderer_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698