[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.144,1.145

Attila Kinali CVS attila at mplayerhq.hu
Sat Sep 6 15:40:22 CEST 2003


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv22550

Modified Files:
	vo_xv.c 
Log Message:
add port parameter to -vo xv
based on patch from Jean-Yves Simon <lethalwp at tiscali.be>


Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -r1.144 -r1.145
--- vo_xv.c	31 Aug 2003 22:27:10 -0000	1.144
+++ vo_xv.c	6 Sep 2003 13:40:00 -0000	1.145
@@ -593,14 +593,22 @@
     XvPortID xv_p;
     int busy_ports=0;
     
+    xv_port = 0;
+
     if(arg) 
     {
-	mp_msg(MSGT_VO,MSGL_ERR,"vo_xv: Unknown subdevice: %s\n",arg);
-	return ENOSYS;
+	if ((strlen(arg) >= 6) && !strncmp(arg, "port=", 5))
+	{
+	    xv_port = atoi(arg+5);
+	}
+	else
+	{
+	    mp_msg(MSGT_VO,MSGL_ERR,"vo_xv: Unknown subdevice: %s\n",arg);
+	    return ENOSYS;
+	}
     }
     if (!vo_init()) return -1;
 
-    xv_port = 0;
    /* check for Xvideo extension */
     if (Success != XvQueryExtension(mDisplay,&ver,&rel,&req,&ev,&err)){
 	mp_msg(MSGT_VO,MSGL_ERR,"Sorry, Xv not supported by this X11 version/driver\n");
@@ -610,11 +618,22 @@
     
    /* check for Xvideo support */
     if (Success != XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay), &adaptors,&ai)){
-	mp_msg(MSGT_VO,MSGL_ERR,"Xv: XvQueryAdaptors failed");
+	mp_msg(MSGT_VO,MSGL_ERR,"Xv: XvQueryAdaptors failed\n");
 	return -1;
     }
 
    /* check adaptors */
+    if(xv_port >= adaptors)
+    {
+    	mp_msg(MSGT_VO, MSGL_WARN,"Xv: Invalid port parameter, overriding with port 0\n");
+    	xv_port = 0;
+    }
+    if (xv_port)
+    {
+      if (XvGrabPort(mDisplay, xv_port, CurrentTime))
+        xv_port = 0;
+    }
+   
     for (i = 0; i < adaptors && xv_port == 0; i++){
       if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask)) {
 	 for (xv_p = ai[i].base_id; xv_p < ai[i].base_id+ai[i].num_ports; ++xv_p)



More information about the MPlayer-cvslog mailing list