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

Side by Side Diff: media/base/audio_renderer_mixer_input.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 unified diff | Download patch
« no previous file with comments | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/audio_renderer_mixer_input.h" 5 #include "media/base/audio_renderer_mixer_input.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "media/base/audio_renderer_mixer.h" 9 #include "media/base/audio_renderer_mixer.h"
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 OutputDeviceStatus AudioRendererMixerInput::GetDeviceStatus() { 159 OutputDeviceStatus AudioRendererMixerInput::GetDeviceStatus() {
160 if (!mixer_) 160 if (!mixer_)
161 return OUTPUT_DEVICE_STATUS_ERROR_INTERNAL; 161 return OUTPUT_DEVICE_STATUS_ERROR_INTERNAL;
162 162
163 return mixer_->GetOutputDevice()->GetDeviceStatus(); 163 return mixer_->GetOutputDevice()->GetDeviceStatus();
164 } 164 }
165 165
166 double AudioRendererMixerInput::ProvideInput(AudioBus* audio_bus, 166 double AudioRendererMixerInput::ProvideInput(AudioBus* audio_bus,
167 base::TimeDelta buffer_delay) { 167 base::TimeDelta buffer_delay) {
168 int frames_filled = callback_->Render( 168 int frames_filled = callback_->Render(
169 audio_bus, static_cast<int>(buffer_delay.InMillisecondsF() + 0.5)); 169 audio_bus, static_cast<int>(buffer_delay.InMillisecondsF() + 0.5), 0);
170 170
171 // AudioConverter expects unfilled frames to be zeroed. 171 // AudioConverter expects unfilled frames to be zeroed.
172 if (frames_filled < audio_bus->frames()) { 172 if (frames_filled < audio_bus->frames()) {
173 audio_bus->ZeroFramesPartial( 173 audio_bus->ZeroFramesPartial(
174 frames_filled, audio_bus->frames() - frames_filled); 174 frames_filled, audio_bus->frames() - frames_filled);
175 } 175 }
176 176
177 return frames_filled > 0 ? volume_ : 0; 177 return frames_filled > 0 ? volume_ : 0;
178 } 178 }
179 179
180 void AudioRendererMixerInput::OnRenderError() { 180 void AudioRendererMixerInput::OnRenderError() {
181 callback_->OnRenderError(); 181 callback_->OnRenderError();
182 } 182 }
183 183
184 } // namespace media 184 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698