[MPlayer-cvslog] CVS: main/libvo vo_sdl.c,1.118,1.119

Ivo van Poorten CVS syncmail at mplayerhq.hu
Tue Mar 1 04:51:50 CET 2005


CVS change done by Ivo van Poorten CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv29748/libvo

Modified Files:
	vo_sdl.c 
Log Message:

Remove -noxv and -forcexv command line options and replace them by
suboptions to -vo sdl. Renamed noxv to nohwaccel to better reflect the
meaning of the option. Updated manual page.

Original patch by < ods15 at ods15 dot dyndns dot org>
Modified by me.



Index: vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- vo_sdl.c	22 Jan 2005 18:05:07 -0000	1.118
+++ vo_sdl.c	1 Mar 2005 03:51:48 -0000	1.119
@@ -121,10 +121,9 @@
 
 #include "input/input.h"
 #include "input/mouse.h"
+#include "subopt-helper.h"
 
 extern int verbose;
-int sdl_noxv;
-int sdl_forcexv;
 
 static vo_info_t info = 
 {
@@ -1594,6 +1593,21 @@
 static uint32_t preinit(const char *arg)
 {
     struct sdl_priv_s *priv = &sdl_priv;
+    char * sdl_driver;
+    int sdl_hwaccel;
+    int sdl_forcexv;
+    opt_t subopts[] = {
+	    {"forcexv", OPT_ARG_BOOL,  &sdl_forcexv, NULL, 0},
+	    {"hwaccel", OPT_ARG_BOOL,  &sdl_hwaccel, NULL, 0},
+	    {"driver",  OPT_ARG_MSTRZ, &sdl_driver,  NULL, 0},
+	    {NULL, 0, NULL, NULL, 0}
+    };
+
+    sdl_forcexv = 1;
+    sdl_hwaccel = 1;
+    sdl_driver = strdup("x11");
+
+    if (subopt_parse(arg, subopts) != 0) return -1;
 
     priv->rgbsurface = NULL;
     priv->overlay = NULL;
@@ -1601,13 +1615,16 @@
 
     if(verbose > 2) printf("SDL: Opening Plugin\n");
 
-    if(arg) setenv("SDL_VIDEODRIVER", arg, 1);
+    if(sdl_driver) setenv("SDL_VIDEODRIVER", sdl_driver, 1);
+    free(sdl_driver);
 
     /* does the user want SDL to try and force Xv */
     if(sdl_forcexv)	setenv("SDL_VIDEO_X11_NODIRECTCOLOR", "1", 1);
+    else setenv("SDL_VIDEO_X11_NODIRECTCOLOR", "0", 1);
 
     /* does the user want to disable Xv and use software scaling instead */
-    if(sdl_noxv) setenv("SDL_VIDEO_YUV_HWACCEL", "0", 1);
+    if(sdl_hwaccel) setenv("SDL_VIDEO_YUV_HWACCEL", "1", 1);
+    else setenv("SDL_VIDEO_YUV_HWACCEL", "0", 1);
 
     /* default to no fullscreen mode, we'll set this as soon we have the avail. modes */
     priv->fullmode = -2;




More information about the MPlayer-cvslog mailing list