Commit e5b58f69 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/vdvda: add extra safety during DRC

When a dynamic resolution change even happens, we dismiss all the
pictures that were sent to the client. Although it should never happen,
if a reuse picture event takes place, it will re-insert the picture ID
into the "at client" map, messing with reference count and resulting in
broken playback. Make sure this does not happen by clearing the entry
for a picture ID when it gets imported again.

BUG=b:161759267
BUG=b:165035340
BUG=b:172881995
TEST=DRC with Youtube Android app on Trogdor now takes place smoothly.
TEST=CtsMediaTestCases android.media.cts.AdaptivePlaybackTest#testH264Adaptive
passes on Trogdor

Change-Id: I503a6aacbe8647398fe502eded3ed6c799aa2faa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2548588
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829135}
parent 8c8edcc7
...@@ -386,8 +386,10 @@ void VdVideoDecodeAccelerator::ImportBufferForPicture( ...@@ -386,8 +386,10 @@ void VdVideoDecodeAccelerator::ImportBufferForPicture(
// let's make sure the slot for the picture buffer ID is free, otherwise we // let's make sure the slot for the picture buffer ID is free, otherwise we
// might lose track of the reference count and keep frames out of the pool // might lose track of the reference count and keep frames out of the pool
// forever. // forever.
DCHECK(picture_at_client_.find(picture_buffer_id) == if (picture_at_client_.erase(picture_buffer_id) > 0) {
picture_at_client_.end()); VLOGF(1) << "Picture " << picture_buffer_id
<< " still referenced, dropping it.";
}
DCHECK(import_frame_cb_); DCHECK(import_frame_cb_);
import_frame_cb_.Run(std::move(wrapped_frame)); import_frame_cb_.Run(std::move(wrapped_frame));
......
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