Index: media/filters/video_renderer_base.cc |
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc |
index e4d90c78d2fe70e6fccb40691f393122791d533e..ec8b6611818dae2ffebba07bb872e6626006fa75 100644 |
--- a/media/filters/video_renderer_base.cc |
+++ b/media/filters/video_renderer_base.cc |
@@ -209,18 +209,19 @@ void VideoRendererBase::ThreadMain() { |
continue; |
} |
+ // If the next frame is end of stream then we are truly at the end of the |
+ // video stream. |
+ if (ready_frames_.front()->IsEndOfStream()) { |
DaleCurtis
2012/08/06 21:44:35
Not super familiar with this code, but won't this
scherkus (not reviewing)
2012/08/06 23:36:46
I wondered about that in acolwell's previous chang
|
+ state_ = kEnded; |
+ ended_cb_.Run(); |
+ ready_frames_.clear(); |
+ |
+ // No need to sleep here as we idle when |state_ != kPlaying|. |
+ continue; |
+ } |
+ |
// Remain idle until we've initialized |current_frame_| via prerolling. |
if (!current_frame_) { |
- // This can happen if our preroll only contains end of stream frames. |
- if (ready_frames_.front()->IsEndOfStream()) { |
- state_ = kEnded; |
- ended_cb_.Run(); |
- ready_frames_.clear(); |
- |
- // No need to sleep here as we idle when |state_ != kPlaying|. |
- continue; |
- } |
- |
frame_available_.TimedWait(kIdleTimeDelta); |
continue; |
} |
@@ -245,21 +246,6 @@ void VideoRendererBase::ThreadMain() { |
// At this point we've rendered |current_frame_| for the proper amount |
// of time and also have the next frame that ready for rendering. |
- |
- // If the next frame is end of stream then we are truly at the end of the |
- // video stream. |
- // |
- // TODO(scherkus): deduplicate this end of stream check after we get rid of |
- // |current_frame_|. |
- if (ready_frames_.front()->IsEndOfStream()) { |
- state_ = kEnded; |
- ended_cb_.Run(); |
- ready_frames_.clear(); |
- |
- // No need to sleep here as we idle when |state_ != kPlaying|. |
- continue; |
- } |
- |
// We cannot update |current_frame_| until we've completed the pending |
// paint. Furthermore, the pending paint might be really slow: check to |
// see if we have any ready frames that we can drop if they've already |
@@ -290,7 +276,6 @@ void VideoRendererBase::ThreadMain() { |
continue; |
} |
- |
// Congratulations! You've made it past the video frame timing gauntlet. |
// |
// We can now safely update the current frame, request another frame, and |