SSE check incorrect + strndup fix

Steven M. Schultz sms at 2BSD.COM
Sat Jun 15 11:05:01 CEST 2002


Greetings -

	The SSE check in ./configure is not correct.  It is _not_ safe
	to assume that if a  SSE instruction compiles that the OS supports
	SSE!   configure.in needs to run a test program (which catches
	SIGILL) in order to determine if SSE can be enabked.   In order
	to get 'vlc' to run at all I had to apply this patch:

--- configure.in.dist	Thu Jun 13 23:32:13 2002
+++ configure.in	Sat Jun 15 01:47:21 2002
@@ -458,7 +458,7 @@
     [ac_cv_sse_inline],
     [CFLAGS="${save_CFLAGS}"
      AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
-                    ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
+                    ac_cv_sse_inline=no, ac_cv_sse_inline=no)])
 if test x"$ac_cv_sse_inline" != x"no" -a x$SYS != xmingw32; then
   AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"

	Ugly, but it prevented vlc from locking up in an endless loop.

	Here is a (rather elegant if I do say so myself ;)) solution to
	the strndup undefined symbol bug:

--- src/video_output/video_output.c.dist	Thu Jun 13 23:32:14 2002
+++ src/video_output/video_output.c	Sat Jun 15 01:26:31 2002
@@ -106,11 +106,11 @@
          * colons */
         char *psz_end;
 
-        psz_end = strchr( p_vout->psz_filter_chain, ':' );
+        psz_plugin = strdup( p_vout->psz_filter_chain );
+
+        psz_end = strchr(psz_plugin, ':' );
         if( psz_end )
-            psz_plugin = strndup( p_vout->psz_filter_chain,
-                                  psz_end - p_vout->psz_filter_chain );
-        else psz_plugin = strdup( p_vout->psz_filter_chain );
+            *psz_end = '\0';
     }
 
     /* Initialize pictures and subpictures - translation tables and functions

	Why not strdup the data and then conditionally null out the ':'?

	Does 'vlc' accept commandline arguments?  If so it would be _really_
	nice if "vlc --help" would give a list of valid options.

	Cheers,
	Steven Schultz
	sms at 2bsd.com

-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc mailing list