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

Unified Diff: media/audio/mac/audio_auhal_mac.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/audio/mac/audio_auhal_mac.h ('k') | media/audio/mac/audio_auhal_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_auhal_mac.cc
diff --git a/media/audio/mac/audio_auhal_mac.cc b/media/audio/mac/audio_auhal_mac.cc
index 9961ccf1702e19fa8032cc8d4fa21e950c8d4c1a..ab0d26e5ba41c07565eefff1d7fe3908e222ec23 100644
--- a/media/audio/mac/audio_auhal_mac.cc
+++ b/media/audio/mac/audio_auhal_mac.cc
@@ -53,6 +53,7 @@ AUHALStream::AUHALStream(AudioManagerMac* manager,
hardware_latency_frames_(0),
stopped_(true),
current_hardware_pending_bytes_(0),
+ current_lost_frames_(0),
last_sample_time_(0.0),
last_number_of_frames_(0),
total_lost_frames_(0),
@@ -260,11 +261,11 @@ void AUHALStream::ProvideInput(int frame_delay, AudioBus* dest) {
}
// Supply the input data and render the output data.
- source_->OnMoreData(
- dest,
- current_hardware_pending_bytes_ +
- frame_delay * params_.GetBytesPerFrame());
+ source_->OnMoreData(dest, current_hardware_pending_bytes_ +
+ frame_delay * params_.GetBytesPerFrame(),
+ current_lost_frames_);
dest->Scale(volume_);
+ current_lost_frames_ = 0;
}
// AUHAL callback.
@@ -372,6 +373,7 @@ void AUHALStream::UpdatePlayoutTimestamp(const AudioTimeStamp* timestamp) {
// glitch count etc and keep a record of the largest glitch.
auto lost_frames = diff - last_number_of_frames_;
total_lost_frames_ += lost_frames;
+ current_lost_frames_ += lost_frames;
if (lost_frames > largest_glitch_frames_)
largest_glitch_frames_ = lost_frames;
++glitches_detected_;
« no previous file with comments | « media/audio/mac/audio_auhal_mac.h ('k') | media/audio/mac/audio_auhal_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698