diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-11-24 15:14:22 +0100 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2017-03-21 06:17:28 +0100 |
commit | e0cd598bc4684654d63942e9ff4872c0b48a7dc2 (patch) | |
tree | 4d342847caf85a15ef39d57508bcd458e1da02ff /libavcodec/vdpau_h264.c | |
parent | 14bb15bfd56d6e907fabe4620206c1ee152b7a20 (diff) | |
download | ffmpeg-e0cd598bc4684654d63942e9ff4872c0b48a7dc2.tar.gz |
pthread_frame: do not run hwaccel decoding asynchronously unless it's safe
Certain hardware decoding APIs are not guaranteed to be thread-safe, so
having the user access decoded hardware surfaces while the decoder is
running in another thread can cause failures (this is mainly known to
happen with DXVA2).
For such hwaccels, only allow the decoding thread to run while the user
is inside a lavc decode call (avcodec_send_packet/receive_frame).
Merges Libav commit d4a91e65.
Signed-off-by: wm4 <nfxjfg@googlemail.com>
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/vdpau_h264.c')
-rw-r--r-- | libavcodec/vdpau_h264.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c index 7265af2890..be6ba71433 100644 --- a/libavcodec/vdpau_h264.c +++ b/libavcodec/vdpau_h264.c @@ -27,6 +27,7 @@ #include "internal.h" #include "h264dec.h" #include "h264_ps.h" +#include "hwaccel.h" #include "mpegutils.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -273,4 +274,5 @@ AVHWAccel ff_h264_vdpau_hwaccel = { .init = vdpau_h264_init, .uninit = ff_vdpau_common_uninit, .priv_data_size = sizeof(VDPAUContext), + .caps_internal = HWACCEL_CAP_ASYNC_SAFE, }; |