[vlc-devel] [PATCH 0/4] use the decoder pool only when a frame is decoded in avcodec va

Steve Lhomme robux4 at videolabs.io
Tue Nov 29 14:19:34 CET 2016

Following the issue I found in the past few days with D3D11VA and its limits
on surface count and deadlocks when playing certain files, I reworked an old
branch that was also solving this issue.

The idea is that we only get a picture from the decoder pool when the AVFrame
with the decoded data is ready, rather than before it is ready. So if the
va decoder needs 5 frames before outputing one it doesn't starve the decoder
pool for no reason.

This was tested on Windows and on Linux with vdpau since the reference counting
and memory release is a bit different now as it was relying on picture->context
but it's not used anymore during the decoding.

Steve Lhomme (4):
  avcodec: va: respect the buffer release prototype
  avcodec: va: assert sooner when the data are not right
  avcodec: reverse the if() logic between p_sys->p_va and p_pic NULL
  avcodec: va: get the picture to send to the vout during Extract() not

 modules/codec/avcodec/d3d11va.c    |  8 ++--
 modules/codec/avcodec/directx_va.c | 14 +++----
 modules/codec/avcodec/directx_va.h |  4 +-
 modules/codec/avcodec/dxva2.c      |  8 ++--
 modules/codec/avcodec/va.h         | 33 +++++++++++------
 modules/codec/avcodec/vaapi.c      | 16 ++++----
 modules/codec/avcodec/vda.c        | 10 +++--
 modules/codec/avcodec/video.c      | 75 +++++++++++++++++++++-----------------
 modules/hw/vdpau/avcodec.c         | 16 ++++++--
 9 files changed, 102 insertions(+), 82 deletions(-)


More information about the vlc-devel mailing list