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

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


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

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

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

 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..143634c 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);
+        return swfmt;
+    }
+#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