Commit 4757ae1a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

avcodec: disable hwaccel when unsupported/broken (fixes #16642)

parent 51cbbae6
......@@ -2404,15 +2404,6 @@ have_avcodec_dxva2="no"
AS_IF([test "${enable_dxva2}" != "no"], [
if test "${SYS}" = "mingw32"; then
AS_IF([test "x${have_avcodec}" = "xyes"], [
case "${avfork}" in
ffmpeg)
PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [
AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.])
])
])
;;
esac
AC_CHECK_HEADERS(dxva2api.h,
[
AC_CHECK_HEADERS(libavcodec/dxva2.h, [
......@@ -3113,16 +3104,6 @@ AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
have_avcodec_vdpau="no"
AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
case "${avfork}" in
libav) av_vdpau_ver="55.26.0" ;;
ffmpeg) av_vdpau_ver="55.42.100"
PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [
AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.])
])
])
;;
esac
PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
have_avcodec_vdpau="yes"
AC_MSG_NOTICE([VDPAU decoding acceleration activated])
......
......@@ -1171,6 +1171,15 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
if (!can_hwaccel)
return swfmt;
#if (LIBAVCODEC_VERSION_MICRO >= 100) /* FFmpeg only */
if (p_context->active_thread_type)
{
msg_Warn(p_dec, "thread type %d: disabling hardware acceleration",
p_context->active_thread_type);
return swfmt;
}
#endif
wait_mt(p_sys);
for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment