[vlc-commits] avcodec: disable hwaccel when unsupported/broken (fixes #16642)

Rémi Denis-Courmont git at videolan.org
Fri Mar 4 03:40:36 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar  4 04:38:01 2016 +0200| [21b66f20a7bb23766e30e6b126ef498e1dce11e6] | committer: Rémi Denis-Courmont

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21b66f20a7bb23766e30e6b126ef498e1dce11e6
---

 configure.ac                  |   19 -------------------
 modules/codec/avcodec/video.c |    9 +++++++++
 2 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/configure.ac b/configure.ac
index be65881..d9cc6cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 6b23375..aaff48b 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -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);
+        can_hwaccel = false;
+    }
+#endif
+
     wait_mt(p_sys);
 
     for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )



More information about the vlc-commits mailing list