summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau_vc1.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-11-24 15:14:22 +0100
committerAnton Khirnov <anton@khirnov.net>2016-12-19 08:10:22 +0100
commitd4a91e65343be5d79a4afa61c791191e1b57499a (patch)
treeb6a191f872f3162949018d145d2d706f106fd8b9 /libavcodec/vdpau_vc1.c
parent8dfba25ce89b62c80ba83e2116d549176c376144 (diff)
downloadffmpeg-d4a91e65343be5d79a4afa61c791191e1b57499a.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).
Diffstat (limited to 'libavcodec/vdpau_vc1.c')
-rw-r--r--libavcodec/vdpau_vc1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c
index 4f87c52ecc..251d1aae5d 100644
--- a/libavcodec/vdpau_vc1.c
+++ b/libavcodec/vdpau_vc1.c
@@ -24,6 +24,7 @@
#include <vdpau/vdpau.h>
#include "avcodec.h"
+#include "hwaccel.h"
#include "vc1.h"
#include "vdpau.h"
#include "vdpau_internal.h"
@@ -143,6 +144,7 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = {
.init = vdpau_vc1_init,
.uninit = ff_vdpau_common_uninit,
.priv_data_size = sizeof(VDPAUContext),
+ .caps_internal = HWACCEL_CAP_ASYNC_SAFE,
};
#endif
@@ -158,4 +160,5 @@ AVHWAccel ff_vc1_vdpau_hwaccel = {
.init = vdpau_vc1_init,
.uninit = ff_vdpau_common_uninit,
.priv_data_size = sizeof(VDPAUContext),
+ .caps_internal = HWACCEL_CAP_ASYNC_SAFE,
};