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

Unified Diff: media/audio/audio_output_controller.cc

Issue 1487983002: 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: Writing skipped frames to shared memory. 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
Index: media/audio/audio_output_controller.cc
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc
index 8aa2b4f38acfdfa989986ab5f4b035c3f1627bc9..6b59434e42e8eb03e861d7fcb38eb757f28767fa 100644
--- a/media/audio/audio_output_controller.cc
+++ b/media/audio/audio_output_controller.cc
@@ -160,7 +160,7 @@ void AudioOutputController::DoPlay() {
return;
// Ask for first packet.
- sync_reader_->UpdatePendingBytes(0);
+ sync_reader_->UpdatePendingBytes(0, 0);
state_ = kPlaying;
@@ -213,7 +213,7 @@ void AudioOutputController::DoPause() {
// Let the renderer know we've stopped. Necessary to let PPAPI clients know
// audio has been shutdown. TODO(dalecurtis): This stinks. PPAPI should have
// a better way to know when it should exit PPB_Audio_Shared::Run().
- sync_reader_->UpdatePendingBytes(kuint32max);
+ sync_reader_->UpdatePendingBytes(kuint32max, 0);
handler_->OnPaused();
}
@@ -280,7 +280,8 @@ void AudioOutputController::DoReportError() {
}
int AudioOutputController::OnMoreData(AudioBus* dest,
- uint32 total_bytes_delay) {
+ uint32_t total_bytes_delay,
+ uint32_t frames_skipped) {
TRACE_EVENT0("audio", "AudioOutputController::OnMoreData");
// Indicate that we haven't wedged (at least not indefinitely, WedgeCheck()
@@ -293,8 +294,8 @@ int AudioOutputController::OnMoreData(AudioBus* dest,
sync_reader_->Read(dest);
const int frames = dest->frames();
- sync_reader_->UpdatePendingBytes(base::saturated_cast<uint32>(
- total_bytes_delay + frames * params_.GetBytesPerFrame()));
+ sync_reader_->UpdatePendingBytes(
+ total_bytes_delay + frames * params_.GetBytesPerFrame(), frames_skipped);
if (will_monitor_audio_levels())
power_monitor_.Scan(*dest, frames);

Powered by Google App Engine
This is Rietveld 408576698