| Index: media/gpu/dxva_video_decode_accelerator_win.cc
|
| diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc
|
| index 5b863cceae2c8b5b0b671779013dfe20134d8c75..93f0f08225aa8ce5f7be3a703c5edd5a10e66ecb 100644
|
| --- a/media/gpu/dxva_video_decode_accelerator_win.cc
|
| +++ b/media/gpu/dxva_video_decode_accelerator_win.cc
|
| @@ -1195,7 +1195,7 @@ void DXVAVideoDecodeAccelerator::Reset() {
|
|
|
| void DXVAVideoDecodeAccelerator::Destroy() {
|
| DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
|
| - Invalidate();
|
| + Invalidate(false);
|
| delete this;
|
| }
|
|
|
| @@ -2015,11 +2015,11 @@ void DXVAVideoDecodeAccelerator::StopOnError(
|
| client_ = NULL;
|
|
|
| if (GetState() != kUninitialized) {
|
| - Invalidate();
|
| + Invalidate(false);
|
| }
|
| }
|
|
|
| -void DXVAVideoDecodeAccelerator::Invalidate() {
|
| +void DXVAVideoDecodeAccelerator::Invalidate(bool for_config_change) {
|
| if (GetState() == kUninitialized)
|
| return;
|
|
|
| @@ -2038,7 +2038,7 @@ void DXVAVideoDecodeAccelerator::Invalidate() {
|
| // output picture buffers may need to be recreated in case the video
|
| // resolution changes. We already handle that in the
|
| // HandleResolutionChanged() function.
|
| - if (GetState() != kConfigChange) {
|
| + if (!for_config_change) {
|
| output_picture_buffers_.clear();
|
| stale_output_picture_buffers_.clear();
|
| // We want to continue processing pending input after detecting a config
|
| @@ -2111,6 +2111,8 @@ void DXVAVideoDecodeAccelerator::NotifyFlushDone() {
|
| }
|
|
|
| client_->NotifyFlushDone();
|
| + Invalidate(true);
|
| + Initialize(config_, client_);
|
| }
|
| }
|
|
|
| @@ -3035,7 +3037,7 @@ void DXVAVideoDecodeAccelerator::ConfigChanged(const Config& config) {
|
| DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
|
|
|
| SetState(kConfigChange);
|
| - Invalidate();
|
| + Invalidate(true);
|
| Initialize(config_, client_);
|
| decoder_thread_task_runner_->PostTask(
|
| FROM_HERE,
|
|
|