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

Unified Diff: chromecast/media/cma/base/balanced_media_task_runner_factory.cc

Issue 1127183008: Wake up other streams/task runners after removing ended stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Release lock before calling OnNewTask Created 5 years, 7 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: chromecast/media/cma/base/balanced_media_task_runner_factory.cc
diff --git a/chromecast/media/cma/base/balanced_media_task_runner_factory.cc b/chromecast/media/cma/base/balanced_media_task_runner_factory.cc
index f365534e457e0375302bc83eef001e47c70c289e..3aba0730afee405e1bcd1c0854965556e842b190 100644
--- a/chromecast/media/cma/base/balanced_media_task_runner_factory.cc
+++ b/chromecast/media/cma/base/balanced_media_task_runner_factory.cc
@@ -244,8 +244,14 @@ void BalancedMediaTaskRunnerFactory::OnNewTask() {
void BalancedMediaTaskRunnerFactory::UnregisterMediaTaskRunner(
const scoped_refptr<BalancedMediaTaskRunner>& media_task_runner) {
- base::AutoLock auto_lock(lock_);
- task_runners_.erase(media_task_runner);
+ {
+ base::AutoLock auto_lock(lock_);
+ task_runners_.erase(media_task_runner);
+ }
+ // After removing one of the task runners some of the other task runners might
+ // need to be waken up, if they are no longer blocked by the balancing
+ // restrictions with the old stream.
+ OnNewTask();
}
} // namespace media
« 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