Index: media/filters/gpu_video_decoder.cc |
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc |
index 375a64940d1602f6c174a26801bfa70be138800b..339d5910cd6f36115b88e12344c88f6fe55d57ab 100644 |
--- a/media/filters/gpu_video_decoder.cc |
+++ b/media/filters/gpu_video_decoder.cc |
@@ -787,8 +787,6 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { |
if (!vda_) |
return; |
- state_ = kError; |
- |
// If we have any bitstream buffers, then notify one that an error has |
// occurred. This guarantees that somebody finds out about the error. If |
// we don't do this, and if the max decodes are already in flight, then there |
@@ -799,6 +797,11 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { |
bitstream_buffers_in_decoder_.erase(it); |
} |
+ if (state_ == kDrainingDecoder) |
+ base::ResetAndReturn(&eos_decode_cb_).Run(DecodeStatus::DECODE_ERROR); |
+ |
+ state_ = kError; |
+ |
DLOG(ERROR) << "VDA Error: " << error; |
UMA_HISTOGRAM_ENUMERATION("Media.GpuVideoDecoderError", error, |
media::VideoDecodeAccelerator::ERROR_MAX + 1); |