OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/media/audio_renderer_impl.h" | 5 #include "chrome/renderer/media/audio_renderer_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/renderer/audio_message_filter.h" | 10 #include "chrome/renderer/audio_message_filter.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 AutoLock auto_lock(lock_); | 188 AutoLock auto_lock(lock_); |
189 DCHECK(!pending_request_); | 189 DCHECK(!pending_request_); |
190 pending_request_ = true; | 190 pending_request_ = true; |
191 | 191 |
192 // Use the information provided by the IPC message to adjust the playback | 192 // Use the information provided by the IPC message to adjust the playback |
193 // delay. | 193 // delay. |
194 request_timestamp_ = message_timestamp; | 194 request_timestamp_ = message_timestamp; |
195 request_delay_ = ConvertToDuration(bytes_in_buffer); | 195 request_delay_ = ConvertToDuration(bytes_in_buffer); |
196 } | 196 } |
197 | 197 |
198 // Try to fill in the fulfill the packet request. | 198 // Try to fulfill the packet request. |
199 OnNotifyPacketReady(); | 199 OnNotifyPacketReady(); |
200 } | 200 } |
201 | 201 |
202 void AudioRendererImpl::OnStateChanged( | 202 void AudioRendererImpl::OnStateChanged( |
203 const ViewMsg_AudioStreamState_Params& state) { | 203 const ViewMsg_AudioStreamState_Params& state) { |
204 DCHECK(MessageLoop::current() == io_loop_); | 204 DCHECK(MessageLoop::current() == io_loop_); |
205 | 205 |
206 AutoLock auto_lock(lock_); | 206 AutoLock auto_lock(lock_); |
207 if (stopped_) | 207 if (stopped_) |
208 return; | 208 return; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 prerolling_ = false; | 350 prerolling_ = false; |
351 preroll_bytes_ = 0; | 351 preroll_bytes_ = 0; |
352 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); | 352 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); |
353 } else { | 353 } else { |
354 preroll_bytes_ -= filled; | 354 preroll_bytes_ -= filled; |
355 } | 355 } |
356 } | 356 } |
357 } | 357 } |
358 } | 358 } |
359 } | 359 } |
OLD | NEW |