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

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: Comments. Split out base/ changes. Created 7 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
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 c09dc6ce08b00df873adee71e86cd47da72099c3..99ae6cd646e9d0a67ff3b05f0906c5f788a9db9c 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"
@@ -242,7 +241,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,
@@ -327,15 +326,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);

Powered by Google App Engine
This is Rietveld 408576698