| 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 "content/renderer/media/audio_renderer_impl.h" | 5 #include "content/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/common/render_messages_params.h" | 10 #include "chrome/common/render_messages_params.h" |
| 11 #include "chrome/renderer/audio_message_filter.h" | |
| 12 #include "chrome/renderer/render_view.h" | 11 #include "chrome/renderer/render_view.h" |
| 13 #include "chrome/renderer/render_thread.h" | 12 #include "chrome/renderer/render_thread.h" |
| 14 #include "media/base/filter_host.h" | 13 #include "media/base/filter_host.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 // We will try to fill 200 ms worth of audio samples in each packet. A round | 17 // We will try to fill 200 ms worth of audio samples in each packet. A round |
| 19 // trip latency for IPC messages are typically 10 ms, this should give us | 18 // trip latency for IPC messages are typically 10 ms, this should give us |
| 20 // plenty of time to avoid clicks. | 19 // plenty of time to avoid clicks. |
| 21 const int kMillisecondsPerPacket = 200; | 20 const int kMillisecondsPerPacket = 200; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 DCHECK(MessageLoop::current() == io_loop_); | 352 DCHECK(MessageLoop::current() == io_loop_); |
| 354 | 353 |
| 355 // We treat the IO loop going away the same as stopping. | 354 // We treat the IO loop going away the same as stopping. |
| 356 base::AutoLock auto_lock(lock_); | 355 base::AutoLock auto_lock(lock_); |
| 357 if (stopped_) | 356 if (stopped_) |
| 358 return; | 357 return; |
| 359 | 358 |
| 360 stopped_ = true; | 359 stopped_ = true; |
| 361 DestroyTask(); | 360 DestroyTask(); |
| 362 } | 361 } |
| OLD | NEW |