changeset 7857:3c690d2ad1ac

MPlayer being unable to display video properly on many nVidia graphics cards. One approach is to always set the XV_AUTOPAINT_COLORKEY attribute if available on the XVideo port being used. patch by Ben Liblit <liblit@eecs.berkeley.edu>
author arpi
date Wed, 23 Oct 2002 00:36:55 +0000
parents ac161720f4f0
children 6ccc14497807
files libvo/vo_xv.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xv.c	Wed Oct 23 00:28:27 2002 +0000
+++ b/libvo/vo_xv.c	Wed Oct 23 00:36:55 2002 +0000
@@ -765,6 +765,19 @@
 	return -1;
     }
 
+    {
+      int howmany, i;
+      const XvAttribute * const attributes = XvQueryPortAttributes(mDisplay, xv_port, &howmany);
+      
+      for (i = 0; i < howmany && attributes; i++)
+	if (!strcmp(attributes[i].name, "XV_AUTOPAINT_COLORKEY"))
+	  {
+	    const Atom autopaint = XInternAtom(mDisplay, "XV_AUTOPAINT_COLORKEY", False);
+	    XvSetPortAttribute(mDisplay, xv_port, autopaint, 1);
+	    break;
+	  }
+    }
+
     fo = XvListImageFormats(mDisplay, xv_port, (int*)&formats);
 
     return 0;