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

Unified Diff: media/filters/video_renderer_base.cc

Issue 9295020: Fix ChunkDemuxer seek deadlock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright year. Created 8 years, 11 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 | « media/filters/pipeline_integration_test.cc ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base.cc
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc
index df7350c23d6b640df37cb2101c18a0fe12b30b52..69a6dac0d1553b8d3c87caddd6a9b5e80b79c9b6 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -336,8 +336,6 @@ void VideoRendererBase::PutCurrentFrame(scoped_refptr<VideoFrame> frame) {
}
void VideoRendererBase::FrameReady(scoped_refptr<VideoFrame> frame) {
- DCHECK(frame);
-
base::AutoLock auto_lock(lock_);
DCHECK_NE(state_, kUninitialized);
DCHECK_NE(state_, kStopped);
@@ -352,6 +350,18 @@ void VideoRendererBase::FrameReady(scoped_refptr<VideoFrame> frame) {
return;
}
+ if (!frame) {
+ if (state_ != kSeeking)
+ return;
+
+ // Abort seek early for a NULL frame because we won't get more frames.
+ // A new seek will be requested after this one completes so there is no
+ // point trying to collect more frames.
+ state_ = kPrerolled;
+ ResetAndRunCB(&seek_cb_, PIPELINE_OK);
+ return;
+ }
+
// Discard frames until we reach our desired seek timestamp.
if (state_ == kSeeking && !frame->IsEndOfStream() &&
(frame->GetTimestamp() + frame->GetDuration()) <= seek_timestamp_) {
« no previous file with comments | « media/filters/pipeline_integration_test.cc ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698