amfenc: Retain a reference to D3D frames used as input during the encoding process
authorAlexander Kravchenko <akravchenko188@gmail.com>
Thu, 12 Apr 2018 15:41:35 +0000 (18:41 +0300)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 19 Apr 2018 18:05:24 +0000 (20:05 +0200)
commit78149d6657302b58d5e46e8bc0a521ed009f86f7
treef863c4b44d564bca670ca1335a4c9fa5d694fb54
parentabf806f7f1601c7e54de7f863bbb816af144a88c
amfenc: Retain a reference to D3D frames used as input during the encoding process

This fixes frame corruption issue when decoder started reusing frames
while they are still in use of encoding process

Issue with frame corruption  was reproduced using:

    avconv.exe -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i input.h264 -an -c:v h264_amf output.mkv

It is recommended to use -extra_hw_frames 16 option in case if hw frames
number in pool is not enough

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/amfenc.c
libavcodec/amfenc.h