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

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

Issue 198303002: Reland "Avoid hitting the thread check when WebRtcAudioRenderer is going away" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 074089ab69b506ed051f5262bed4a4dd6a52ddd2..4c1a2c90ab299c27846cebd1c56e730cc9f0f22a 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -247,6 +247,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::GetStats(AudioProcessorStats* stats) {
stats->typing_noise_detected =
(base::subtle::Acquire_Load(&typing_detected_) != false);
« 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