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

Unified Diff: content/renderer/media/media_stream_audio_processor.cc

Issue 178153007: Avoid hitting the thread check when WebRtcAudioRenderer is going away. (Closed) Base URL: http://git.chromium.org/chromium/src.git@libjingle_get_stats
Patch Set: Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_audio_processor.cc
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc
index fc61c3f2b7c7e3b6cc0aad0b67830812c5583cab..720afbf5e54306e641eb207f1d6d0616410599b5 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -218,6 +218,14 @@ void MediaStreamAudioProcessor::OnPlayoutData(media::AudioBus* audio_bus,
audio_processing_->AnalyzeReverseStream(&render_frame_);
}
+void MediaStreamAudioProcessor::OnPlayoutDataSourceChanged() {
+ DCHECK(main_thread_checker_.CalledOnValidThread());
+ // There is no need to hold a lock here since the caller guarantees that
+ // there is no more OnPlayoutData() callback on the render thread.
+ render_thread_checker_.DetachFromThread();
+ render_converter_.reset();
+}
+
void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
const blink::WebMediaConstraints& constraints, int effects) {
DCHECK(!audio_processing_);
« no previous file with comments | « content/renderer/media/media_stream_audio_processor.h ('k') | content/renderer/media/webrtc_audio_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698