Chromium Code Reviews| Index: content/renderer/media/webrtc_audio_device_impl.cc |
| diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc |
| index 7f46506fada893b16edde60a8ebd81d4042d7cc5..2cb2eacbb32a05ab72d41ad2701915a1272ae3f7 100644 |
| --- a/content/renderer/media/webrtc_audio_device_impl.cc |
| +++ b/content/renderer/media/webrtc_audio_device_impl.cc |
| @@ -4,6 +4,7 @@ |
| #include "content/renderer/media/webrtc_audio_device_impl.h" |
| +#include "base/logging.h" |
| #include "base/metrics/histogram.h" |
| #include "base/strings/string_util.h" |
| #include "base/win/windows_version.h" |
| @@ -62,9 +63,15 @@ void WebRtcAudioDeviceImpl::RenderData(media::AudioBus* audio_bus, |
| int sample_rate, |
| int audio_delay_milliseconds, |
| base::TimeDelta* current_time) { |
| - DCHECK(audio_renderer_thread_checker_.CalledOnValidThread()); |
| { |
| base::AutoLock auto_lock(lock_); |
| +#if DCHECK_IS_ON() |
| + DCHECK(renderer_->CurrentThreadIsRenderingThread()); |
| + if (!audio_renderer_thread_checker_.CalledOnValidThread()) { |
| + for (const auto& sink : playout_sinks_) |
| + sink->OnRenderThreadChanged(); |
|
tommi (sloooow) - chröme
2016/06/15 19:29:11
should this method only exist if DCHECK_IS_ON()?
Henrik Grunell
2016/06/16 12:19:16
I don't have strong opinions on this either. I sli
|
| + } |
| +#endif |
| if (!playing_) { |
| // Force silence to AudioBus after stopping playout in case |
| // there is lingering audio data in AudioBus. |