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

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

Issue 2275343002: Stopping cached AudioOutputDevices on AudioRendererSinkCache destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_renderer_sink_cache_impl.cc
diff --git a/content/renderer/media/audio_renderer_sink_cache_impl.cc b/content/renderer/media/audio_renderer_sink_cache_impl.cc
index 7c495eeec54028eaa55e49adddf7fb15ffd96a8b..26b2ba5a31b4e53a3a78ef4858910b12d2623398 100644
--- a/content/renderer/media/audio_renderer_sink_cache_impl.cc
+++ b/content/renderer/media/audio_renderer_sink_cache_impl.cc
@@ -68,7 +68,12 @@ AudioRendererSinkCacheImpl::AudioRendererSinkCacheImpl(
}
AudioRendererSinkCacheImpl::~AudioRendererSinkCacheImpl() {
- // We just release all the cached sinks here.
+ DCHECK(task_runner_->BelongsToCurrentThread());
+ // We just release all the cached sinks here. Stop them first.
+ // We can stop all the sinks, no matter they are used or not, since everything
+ // is being destroyed anyways.
+ for (auto& entry : cache_)
+ entry.sink->Stop();
}
media::OutputDeviceInfo AudioRendererSinkCacheImpl::GetSinkInfo(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698