Mercurial > mplayer.hg
changeset 12709:bd90b887fb13
avoid visuals with low color-depth.
Based on idea from Timo Kanera (timo (at) kanera (dot) de).
author | reimar |
---|---|
date | Sun, 27 Jun 2004 20:45:08 +0000 |
parents | a7e80ffdd89e |
children | 7411f27abe85 |
files | libvo/vo_gl2.c |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_gl2.c Sun Jun 27 19:53:30 2004 +0000 +++ b/libvo/vo_gl2.c Sun Jun 27 20:45:08 2004 +0000 @@ -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;