| Index: content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| index 818e54dd82fa9bee8307ecbbfd09662687d4ee5e..42cc7efb5fa9b2b589520f068e9f87e73c01b7b3 100644
|
| --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| @@ -266,6 +266,8 @@ class GLRenderingVDAClient
|
| // Delete the associated decoder helper.
|
| void DeleteDecoder();
|
|
|
| + void ResetDecoder();
|
| +
|
| // Compute & return the first encoded bytes (including a start frame) to send
|
| // to the decoder, starting at |start_pos| and returning one fragment. Skips
|
| // to the first decodable position.
|
| @@ -533,6 +535,13 @@ void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer(
|
| DecodeNextFragment();
|
| }
|
|
|
| +void GLRenderingVDAClient::ResetDecoder() {
|
| + if (decoder_deleted())
|
| + return;
|
| + decoder_->Reset();
|
| + SetState(CS_RESETTING);
|
| +}
|
| +
|
| void GLRenderingVDAClient::NotifyFlushDone() {
|
| if (decoder_deleted())
|
| return;
|
| @@ -540,10 +549,10 @@ void GLRenderingVDAClient::NotifyFlushDone() {
|
| SetState(CS_FLUSHED);
|
| --remaining_play_throughs_;
|
| DCHECK_GE(remaining_play_throughs_, 0);
|
| - if (decoder_deleted())
|
| - return;
|
| - decoder_->Reset();
|
| - SetState(CS_RESETTING);
|
| +
|
| + // Call Reset until rendering is completed.
|
| + rendering_helper_->SetWaitRenderingCB(
|
| + window_id_, base::Bind(&GLRenderingVDAClient::ResetDecoder, AsWeakPtr()));
|
| }
|
|
|
| void GLRenderingVDAClient::NotifyResetDone() {
|
|
|