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); |