VO: fix X display depth handling (makes depth 30 work)
commit77071fadd799a7cba13b18c31273ed3c217f82f5
authorUoti Urpala <uau@mplayer2.org>
Thu, 24 Jan 2013 23:01:45 +0000 (25 01:01 +0200)
committerUoti Urpala <uau@mplayer2.org>
Thu, 24 Jan 2013 23:01:45 +0000 (25 01:01 +0200)
treee6ffad3912971aff8d3970306214663b4fdf0bc8
parentc5dc8dfe23c58c2a3d554c660c33b40f94ee2db6
VO: fix X display depth handling (makes depth 30 work)

vo_vdpau and vo_xv had code that selected output window depth by
checking X root window depth, using that value if it was one of the
values 15, 16, 24, 32, and otherwise using 24. This broke displays set
in 30-bit mode (at least NVIDIA supports such 10 bits per component
mode), as it tried to use 24 which is not supported in that mode.
Simply remove the list of allowed modes and use whatever the root
window depth is.

The list of allowed modes was originally added for displays that used
8 bits for the root window but allowed creating higher-depth windows
(such displays should not be relevant any more). That it listed
specific modes instead of a simple greater-than comparison is likely
because it was written for vo_x11 which cares about the exact format.
Probably this code was then blindly copied to other VOs.

The same questionable logic was also used in the shared X11 vo_init()
function, but there the result depth wasn't used for anything except
printing verbose-level output and setting the "depthonscreen" variable
that is only used in vo_x11. Move this logic from x11_common.c to
vo_x11.c.
libvo/vo_vdpau.c
libvo/vo_x11.c
libvo/vo_xv.c
libvo/x11_common.c
libvo/x11_common.h