[Mplayer-cvslog] CVS: main/libvo vo_gl2.c,1.45,1.46
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Sun Jun 27 22:45:10 CEST 2004
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv196
Modified Files:
vo_gl2.c
Log Message:
avoid visuals with low color-depth.
Based on idea from Timo Kanera (timo (at) kanera (dot) de).
Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- vo_gl2.c 8 May 2004 23:53:20 -0000 1.45
+++ vo_gl2.c 27 Jun 2004 20:45:08 -0000 1.46
@@ -640,6 +640,18 @@
w += val;
/* and finally, prefer DirectColor-ed visuals to allow color corrections */
if (vi_list[i].class != DirectColor) w += 100;
+
+ // avoid bad-looking visual with less that 8bit per color
+ res = glXGetConfig(dpy, vi_list + i, GLX_RED_SIZE, &val);
+ if (res) continue;
+ if (val < 8) w += 50;
+ res = glXGetConfig(dpy, vi_list + i, GLX_GREEN_SIZE, &val);
+ if (res) continue;
+ if (val < 8) w += 70;
+ res = glXGetConfig(dpy, vi_list + i, GLX_BLUE_SIZE, &val);
+ if (res) continue;
+ if (val < 8) w += 50;
+
if (w < best_weight) {
best_weight = w;
best_i = i;
More information about the MPlayer-cvslog
mailing list