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

Unified Diff: media/filters/video_renderer_base.cc

Issue 10829200: Fix VideoRendererBase end of stream logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dedup EOS code Created 8 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: 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
« 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