summaryrefslogtreecommitdiffstats
path: root/libvo/vo_xv.c
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-22 18:19:02 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-22 18:19:02 +0000
commit7b94d58c45752016e641f2a31b38d19483b6772e (patch)
tree9c59f546e0829fde2526f1c4fd30383cee2a8d38 /libvo/vo_xv.c
parent7f5bcb338f76342799a13d2945c88c1258d6b110 (diff)
downloadmpv-7b94d58c45752016e641f2a31b38d19483b6772e.tar.bz2
mpv-7b94d58c45752016e641f2a31b38d19483b6772e.tar.xz
Attempt to fix NVidia problems
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4308 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_xv.c')
-rw-r--r--libvo/vo_xv.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index ef9f2f0a92..5357f5f2f8 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -125,19 +125,34 @@ extern int vo_gamma_blue_intense;
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 +168,8 @@ static void set_gamma_correction( unsigned int xv_port )
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 +199,6 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t
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);