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

Unified Diff: media/base/pipeline.cc

Issue 512973002: Avoid deadlock between Pipeline and RendererImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | media/filters/renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline.cc
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index 41eeb98d8a1dc85fb8e845815f2a60cf8372451e..5b5826e8099f69716604c40308fea27beee3115c 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -153,9 +153,13 @@ void Pipeline::SetVolume(float volume) {
}
TimeDelta Pipeline::GetMediaTime() const {
+ if (!renderer_)
+ return TimeDelta();
+
+ TimeDelta media_time = renderer_->GetMediaTime();
+
base::AutoLock auto_lock(lock_);
- return renderer_ ? std::min(renderer_->GetMediaTime(), duration_)
- : TimeDelta();
+ return std::min(media_time, duration_);
}
Ranges<TimeDelta> Pipeline::GetBufferedTimeRanges() const {
@@ -439,7 +443,7 @@ void Pipeline::OnStopCompleted(PipelineStatus status) {
DCHECK(!text_renderer_);
{
- base::AutoLock l(lock_);
+ base::AutoLock auto_lock(lock_);
running_ = false;
}
« no previous file with comments | « no previous file | media/filters/renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698