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

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

Issue 22886005: Switch audio synchronization from sleep() based to select() based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK. Created 7 years, 2 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_sync_reader.h » ('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 a89753452bd2d6e4cfeea9079189f5ae868797a4..4a73cef88a6ac5a1b9409079f85988f78cd94fac 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -21,7 +21,6 @@
#include "content/public/browser/media_observer.h"
#include "content/public/common/content_switches.h"
#include "media/audio/audio_manager_base.h"
-#include "media/audio/shared_memory_util.h"
#include "media/base/audio_bus.h"
#include "media/base/limits.h"
@@ -238,7 +237,7 @@ void AudioRendererHost::DoCompleteCreation(int stream_id) {
entry->stream_id(),
foreign_memory_handle,
foreign_socket_handle,
- media::PacketSizeInBytes(entry->shared_memory()->requested_size())));
+ entry->shared_memory()->requested_size()));
}
void AudioRendererHost::DoNotifyAudioPowerLevel(int stream_id,
@@ -323,15 +322,12 @@ void AudioRendererHost::OnCreateStream(
// Calculate output and input memory size.
int output_memory_size = AudioBus::CalculateMemorySize(params);
int frames = params.frames_per_buffer();
- int input_memory_size =
- AudioBus::CalculateMemorySize(input_channels, frames);
+ int input_memory_size = AudioBus::CalculateMemorySize(input_channels, frames);
// Create the shared memory and share with the renderer process.
// For synchronized I/O (if input_channels > 0) then we allocate
// extra memory after the output data for the input data.
- uint32 io_buffer_size = output_memory_size + input_memory_size;
- uint32 shared_memory_size =
- media::TotalSharedMemorySizeInBytes(io_buffer_size);
+ uint32 shared_memory_size = output_memory_size + input_memory_size;
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
if (!shared_memory->CreateAndMapAnonymous(shared_memory_size)) {
SendErrorMessage(stream_id);
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_sync_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698