| 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 83a1234dda5663df2ad4ed9a4dd8546088f89c64..ee56a5df1605a84edc4bbe0c97e5999f71d32096 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_->Flush(
|
| + window_id_, base::Bind(&GLRenderingVDAClient::ResetDecoder, AsWeakPtr()));
|
| }
|
|
|
| void GLRenderingVDAClient::NotifyResetDone() {
|
|
|