summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_vc1.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-11-24 15:14:22 +0100
committerwm4 <nfxjfg@googlemail.com>2017-03-21 06:17:28 +0100
commite0cd598bc4684654d63942e9ff4872c0b48a7dc2 (patch)
tree4d342847caf85a15ef39d57508bcd458e1da02ff /libavcodec/vaapi_vc1.c
parent14bb15bfd56d6e907fabe4620206c1ee152b7a20 (diff)
downloadffmpeg-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/vaapi_vc1.c')
-rw-r--r--libavcodec/vaapi_vc1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
index a456149e6e..30c9ed3c8b 100644
--- a/libavcodec/vaapi_vc1.c
+++ b/libavcodec/vaapi_vc1.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "hwaccel.h"
#include "internal.h"
#include "vaapi_decode.h"
#include "vc1.h"
@@ -399,6 +400,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = {
.init = &ff_vaapi_decode_init,
.uninit = &ff_vaapi_decode_uninit,
.priv_data_size = sizeof(VAAPIDecodeContext),
+ .caps_internal = HWACCEL_CAP_ASYNC_SAFE,
};
#endif
@@ -414,4 +416,5 @@ AVHWAccel ff_vc1_vaapi_hwaccel = {
.init = &ff_vaapi_decode_init,
.uninit = &ff_vaapi_decode_uninit,
.priv_data_size = sizeof(VAAPIDecodeContext),
+ .caps_internal = HWACCEL_CAP_ASYNC_SAFE,
};