[vlc-devel] [PATCH] Error if XvMC is requested while libmpeg2 unavailable

Nicolas Chauvet (kwizart) kwizart at gmail.com
Wed Jun 10 10:46:09 CEST 2009


This patch is aimed to fix:
https://trac.videolan.org/vlc/ticket/2791
---
 configure.ac |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6125f72..f3cf3ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3513,6 +3513,7 @@ fi
 dnl
 dnl  Libmpeg2 plugin
 dnl
+have_libmpeg2=no
 AC_ARG_ENABLE(libmpeg2,
   [  --enable-libmpeg2       libmpeg2 decoder support (default enabled)])
 if test "${enable_libmpeg2}" != "no"
@@ -3535,6 +3536,7 @@ then
       VLC_ADD_PLUGIN([libmpeg2])
       VLC_ADD_LIBS([libmpeg2],[-L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2])
       VLC_ADD_CFLAGS([libmpeg2],[-I${real_libmpeg2_tree}/include])
+      have_libmpeg2=yes
     else
       dnl  The given libmpeg2 wasn't built
       AC_MSG_RESULT(no)
@@ -3545,6 +3547,7 @@ then
           VLC_ADD_PLUGIN([libmpeg2])
           VLC_ADD_LIBS([libmpeg2], $LIBMPEG2_LIBS)
           VLC_ADD_CFLAGS([libmpeg2], $LIBMPEG2_CFLAGS)
+          have_libmpeg2=yes
        ],
       AC_MSG_WARN([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ . Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.]))
   ])
@@ -4086,9 +4089,13 @@ AC_ARG_ENABLE(xvmc,
 ])
 AS_IF([test "${enable_xvmc}" != "no"], [
   AC_CHECK_HEADERS(X11/extensions/vldXvMC.h, [
-    VLC_ADD_PLUGIN([xvmc])
-    VLC_ADD_LIBS([xvmc],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXvMCW -lXv ${LIBMPEG2_LIBS}])
-    VLC_ADD_CPPFLAGS([xvmc],[${X_CFLAGS} ${LIBMPEG2_CFLAGS}])
+    AS_IF([test "${have_libmpeg2}" = "yes"], [
+      VLC_ADD_PLUGIN([xvmc])
+      VLC_ADD_LIBS([xvmc],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXvMCW -lXv ${LIBMPEG2_LIBS}])
+      VLC_ADD_CPPFLAGS([xvmc],[${X_CFLAGS} ${LIBMPEG2_CFLAGS}])
+    ], [
+      AC_MSG_ERROR([XVideo-MotionCompensation needs libmpeg2 which isn't available])
+    ])
   ], [
     AC_MSG_ERROR([XVideo-MotionCompensation extension not found!])
   ])
-- 
1.6.0.6




More information about the vlc-devel mailing list