Commit 0f47fc97 authored by posciak's avatar posciak Committed by Commit bot

VP8Decoder: Drop references to reference frames earlier.

Drop references to reference frames before requesting new surfaces to
ensure we don't hold onto them while the Accelerator is changing resolution,
risking reusing a stale buffer.

BUG=chrome-os-partner:35539
TEST=Hangouts, vdatest

Review URL: https://codereview.chromium.org/880773009

Cr-Commit-Position: refs/heads/master@{#313679}
parent d9fa2c32
...@@ -1265,6 +1265,8 @@ void V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChangeIfNeeded() { ...@@ -1265,6 +1265,8 @@ void V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChangeIfNeeded() {
DCHECK_EQ(state_, kIdle); DCHECK_EQ(state_, kIdle);
DCHECK(decoder_display_queue_.empty()); DCHECK(decoder_display_queue_.empty());
// All output buffers should've been returned from decoder and device by now.
DCHECK_EQ(free_output_buffers_.size(), output_buffer_map_.size());
// Keep input queue running while we switch outputs. // Keep input queue running while we switch outputs.
if (!StopDevicePoll(true)) { if (!StopDevicePoll(true)) {
......
...@@ -75,6 +75,12 @@ VP8Decoder::DecodeResult VP8Decoder::Decode() { ...@@ -75,6 +75,12 @@ VP8Decoder::DecodeResult VP8Decoder::Decode() {
if (new_pic_size != pic_size_) { if (new_pic_size != pic_size_) {
DVLOG(2) << "New resolution: " << new_pic_size.ToString(); DVLOG(2) << "New resolution: " << new_pic_size.ToString();
pic_size_ = new_pic_size; pic_size_ = new_pic_size;
DCHECK(!curr_pic_);
last_frame_ = nullptr;
golden_frame_ = nullptr;
alt_frame_ = nullptr;
return kAllocateNewSurfaces; return kAllocateNewSurfaces;
} }
......
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