[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.41,1.42

Nick Kurshev nick at mplayer.dev.hu
Tue Jan 22 19:19:05 CET 2002


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

Modified Files:
	vo_xv.c 
Log Message:
Attempt to fix NVidia problems

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- vo_xv.c	21 Jan 2002 18:55:51 -0000	1.41
+++ vo_xv.c	22 Jan 2002 18:19:02 -0000	1.42
@@ -125,19 +125,33 @@
 static void set_gamma_correction( unsigned int xv_port )
 {
  XvAttribute *attributes;
- int howmany;
-// get available attributes
+ int howmany, xv_min,xv_max,xv_atomka;
+ static int was_reset = 0;
+/* get available attributes */
      attributes = XvQueryPortAttributes(mDisplay, xv_port, &howmany);
+     /* first pass try reset */
+     if(!was_reset)
+     for (i = 0; i < howmany && attributes; i++)
+     {
+            if (attributes[i].flags & XvSettable && !strcmp(attributes[i].name,"XV_SET_DEFAULTS"
))
+            {
+		was_reset = 1;
+		if(verbose > 1) printf("vo_xv: reset gamma correction\n");
+                xv_atomka = XInternAtom(mDisplay, attributes[i].name, True);
+                XvSetPortAttribute(mDisplay, xv_port, xv_atomka, attributes[i].max_value);
+	    }
+     }
+     /* for safety purposes */
+     if(!was_reset) return;
      for (i = 0; i < howmany && attributes; i++)
      {
             if (attributes[i].flags & XvSettable)
             {
-		int xv_min,xv_max,xv_atomka;
                 xv_min = attributes[i].min_value;
                 xv_max = attributes[i].max_value;
                 xv_atomka = XInternAtom(mDisplay, attributes[i].name, True);
-// since we have SET_DEFAULTS first in our list, we can check if it's available
-// then trigger it if it's ok so that the other values are at default upon query
+/* since we have SET_DEFAULTS first in our list, we can check if it's available
+   then trigger it if it's ok so that the other values are at default upon query */
                 if (xv_atomka != None)
                 {
 		    int port_value,port_min,port_max,port_mid;
@@ -153,6 +167,8 @@
 		    if(strcmp(attributes[i].name,"XV_HUE") == 0)
 				port_value = vo_gamma_hue;
 		    else continue;
+		    /* means that user has untouched this parameter */
+		    if(!port_value) continue;
 		    port_min = xv_min;
 		    port_max = xv_max;
 		    port_mid = (port_min + port_max) / 2;
@@ -182,8 +198,6 @@
  XGCValues xgcv;
  XSetWindowAttributes xswa;
  unsigned long xswamask;
- XvAttribute *attributes;
- int howmany, j, notyetset = 0;
 
  aspect_save_orig(width,height);
  aspect_save_prescale(d_width,d_height);




More information about the MPlayer-cvslog mailing list