Commit a52fe60f authored by jbauman's avatar jbauman Committed by Commit bot

Allow resetting DXVAVDA while it's currently flushing.

video_decode_accelerator_unittest does this, and there's no fundamental
reason it shouldn't work.

Review-Url: https://codereview.chromium.org/2366213004
Cr-Commit-Position: refs/heads/master@{#423058}
parent 712879f1
...@@ -1010,12 +1010,15 @@ void DXVAVideoDecodeAccelerator::Reset() { ...@@ -1010,12 +1010,15 @@ void DXVAVideoDecodeAccelerator::Reset() {
DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset"; DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset";
State state = GetState(); State state = GetState();
RETURN_AND_NOTIFY_ON_FAILURE((state == kNormal || state == kStopped), RETURN_AND_NOTIFY_ON_FAILURE(
"Reset: invalid state: " << state, (state == kNormal || state == kStopped || state == kFlushing),
ILLEGAL_STATE, ); "Reset: invalid state: " << state, ILLEGAL_STATE, );
decoder_thread_.Stop(); decoder_thread_.Stop();
if (state == kFlushing)
NotifyFlushDone();
SetState(kResetting); SetState(kResetting);
// If we have pending output frames waiting for display then we drop those // If we have pending output frames waiting for display then we drop those
......
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