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

Unified Diff: media/audio/audio_output_controller.cc

Issue 481193003: Remove AudioBuffersState usage in Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix audio muter build buster. Created 6 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
« no previous file with comments | « media/audio/audio_output_controller.h ('k') | media/audio/audio_output_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_controller.cc
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc
index 45d308db3effd64f12394570200c1f90b515ea4f..a38bc526f29260d29536f4794503c3882d860939 100644
--- a/media/audio/audio_output_controller.cc
+++ b/media/audio/audio_output_controller.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/debug/trace_event.h"
#include "base/metrics/histogram.h"
+#include "base/numerics/safe_conversions.h"
#include "base/task_runner_util.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
@@ -280,11 +281,11 @@ void AudioOutputController::DoReportError() {
}
int AudioOutputController::OnMoreData(AudioBus* dest,
- AudioBuffersState buffers_state) {
+ uint32 total_bytes_delay) {
TRACE_EVENT0("audio", "AudioOutputController::OnMoreData");
// Indicate that we haven't wedged (at least not indefinitely, WedgeCheck()
- // may have already fired if OnMoreIOData() took an abnormal amount of time).
+ // may have already fired if OnMoreData() took an abnormal amount of time).
// Since this thread is the only writer of |on_more_io_data_called_| once the
// thread starts, its safe to compare and then increment.
if (base::AtomicRefCountIsZero(&on_more_io_data_called_))
@@ -293,8 +294,8 @@ int AudioOutputController::OnMoreData(AudioBus* dest,
sync_reader_->Read(dest);
const int frames = dest->frames();
- sync_reader_->UpdatePendingBytes(
- buffers_state.total_bytes() + frames * params_.GetBytesPerFrame());
+ sync_reader_->UpdatePendingBytes(base::saturated_cast<uint32>(
+ total_bytes_delay + frames * params_.GetBytesPerFrame()));
if (will_monitor_audio_levels())
power_monitor_.Scan(*dest, frames);
« no previous file with comments | « media/audio/audio_output_controller.h ('k') | media/audio/audio_output_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698