Commit 8b48900e authored by scherkus@chromium.org's avatar scherkus@chromium.org

Clear VideoRendererBase::current_frame_ when stopped.

I previously assumed that PipelineImpl would go through a clean Pause/Flush/Stop on an error but it turns out that Stop() can be called at anytime. Fortunately a DCHECK() would catch this condition and was easily triggerable using the test case attached in bug 100434.

Review URL: http://codereview.chromium.org/8561019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110778 0039d316-1c4b-4281-b951-d872f2087c98
parent 03f41ec4
......@@ -477,6 +477,7 @@ void VideoRendererBase::DoStopOrError_Locked() {
DCHECK(!pending_paint_);
DCHECK(!pending_paint_with_last_available_);
lock_.AssertAcquired();
current_frame_ = NULL;
last_available_frame_ = NULL;
DCHECK(!pending_read_);
}
......
......@@ -379,6 +379,13 @@ TEST_F(VideoRendererBaseTest, GetCurrentFrame_Shutdown) {
ExpectCurrentFrame(false);
}
// Stop() is called immediately during an error.
TEST_F(VideoRendererBaseTest, GetCurrentFrame_Error) {
Initialize();
Stop();
ExpectCurrentFrame(false);
}
// Verify that shutdown can only proceed after we return the current frame.
TEST_F(VideoRendererBaseTest, Shutdown_DuringPaint) {
Initialize();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment