[vlc-devel] [PATCH] swscale: don't enable the module if the library is too old

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 9 13:11:05 CEST 2020


No need to compile the module and have the Open always fail.
---
 configure.ac                   |  2 +-
 modules/video_chroma/swscale.c | 16 ----------------
 2 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index 99e46699424..b633ca8eda0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2814,7 +2814,7 @@ AC_ARG_ENABLE([swscale],
           (default enabled)]))
 if test "${enable_swscale}" != "no"
 then
-  PKG_CHECK_MODULES(SWSCALE,[libswscale],
+  PKG_CHECK_MODULES(SWSCALE,[libswscale >= 0.5.0],
     [
       VLC_SAVE_FLAGS
       CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c
index 8d5106ffd61..b96dde00dc2 100644
--- a/modules/video_chroma/swscale.c
+++ b/modules/video_chroma/swscale.c
@@ -76,7 +76,6 @@ vlc_module_begin ()
 vlc_module_end ()
 
 /* Version checking */
-#if LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)
 /****************************************************************************
  * Local prototypes
  ****************************************************************************/
@@ -235,10 +234,8 @@ static int GetSwsCpuMask(void)
 #if defined(__i386__) || defined(__x86_64__)
     if( vlc_CPU_MMX() )
         i_sws_cpu |= SWS_CPU_CAPS_MMX;
-#if (LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0))
     if( vlc_CPU_MMXEXT() )
         i_sws_cpu |= SWS_CPU_CAPS_MMX2;
-#endif
     if( vlc_CPU_3dNOW() )
         i_sws_cpu |= SWS_CPU_CAPS_3DNOW;
 #elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
@@ -713,16 +710,3 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     picture_Release( p_pic );
     return p_pic_dst;
 }
-
-#else /* LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0) */
-
-int OpenScaler( vlc_object_t *p_this )
-{
-    return VLC_EGENERIC;
-}
-
-void CloseScaler( vlc_object_t *p_this )
-{
-}
-
-#endif /* LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0) */
-- 
2.26.2



More information about the vlc-devel mailing list