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

Unified Diff: ppapi/shared_impl/ppb_audio_shared.cc

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years 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 | « media/renderers/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_audio_shared.cc
diff --git a/ppapi/shared_impl/ppb_audio_shared.cc b/ppapi/shared_impl/ppb_audio_shared.cc
index 8747cc4adebdf04cdb851b32856f771ba01c4e28..04a8847ff5f6c73c8d1bf2433b51715f86231c6e 100644
--- a/ppapi/shared_impl/ppb_audio_shared.cc
+++ b/ppapi/shared_impl/ppb_audio_shared.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
+#include "media/audio/audio_parameters.h"
#include "ppapi/nacl_irt/public/irt_ppapi.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/ppb_audio_config_shared.h"
@@ -112,8 +113,14 @@ void PPB_Audio_Shared::SetStreamInfo(
std::string(),
"Failed to map shared memory for PPB_Audio_Shared.");
} else {
- audio_bus_ = media::AudioBus::WrapMemory(
- kAudioOutputChannels, sample_frame_count, shared_memory_->memory());
+ DCHECK_EQ(shared_memory_size_,
+ sizeof(media::AudioOutputBufferParameters) +
+ media::AudioBus::CalculateMemorySize(kAudioOutputChannels,
+ sample_frame_count));
+ media::AudioOutputBuffer* buffer =
+ reinterpret_cast<media::AudioOutputBuffer*>(shared_memory_->memory());
+ audio_bus_ = media::AudioBus::WrapMemory(kAudioOutputChannels,
+ sample_frame_count, buffer->audio);
// Setup integer audio buffer for user audio data.
client_buffer_size_bytes_ = audio_bus_->frames() * audio_bus_->channels() *
kBitsPerAudioOutputSample / 8;
« no previous file with comments | « media/renderers/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698