changeset 33301:899d817e56fc

Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct, instead of employing vaarg. Do the same for vidix_control() too. Simplifies a lot of code. Allows direct passing of the struct from video filter system. Makes possible the complete removal of vaarg from libvo. Patch inspired by old work of uau.
author iive
date Fri, 06 May 2011 10:32:46 +0000
parents c7ebb0b711a6
children ae69321fd48b
files libmpcodecs/vf_vo.c libvo/mga_template.c libvo/vo_aa.c libvo/vo_cvidix.c libvo/vo_dfbmga.c libvo/vo_directfb2.c libvo/vo_directx.c libvo/vo_dxr3.c libvo/vo_fbdev.c libvo/vo_gl.c libvo/vo_gl2.c libvo/vo_kva.c libvo/vo_matrixview.c libvo/vo_svga.c libvo/vo_vdpau.c libvo/vo_vesa.c libvo/vo_winvidix.c libvo/vo_x11.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c libvo/vosub_vidix.c
diffstat 22 files changed, 123 insertions(+), 399 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_vo.c	Fri May 06 10:12:54 2011 +0000
+++ b/libmpcodecs/vf_vo.c	Fri May 06 10:32:46 2011 +0000
@@ -105,15 +105,13 @@
     }
     case VFCTRL_SET_EQUALIZER:
     {
-	vf_equalizer_t *eq=data;
 	if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
-	return (video_out->control(VOCTRL_SET_EQUALIZER, eq->item, eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
+	return (video_out->control(VOCTRL_SET_EQUALIZER, data) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
     }
     case VFCTRL_GET_EQUALIZER:
     {
-	vf_equalizer_t *eq=data;
 	if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
-	return (video_out->control(VOCTRL_GET_EQUALIZER, eq->item, &eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
+	return (video_out->control(VOCTRL_GET_EQUALIZER, data) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
     }
 #ifdef CONFIG_ASS
     case VFCTRL_INIT_EOSD:
--- a/libvo/mga_template.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/mga_template.c	Fri May 06 10:32:46 2011 +0000
@@ -18,6 +18,7 @@
 
 #include "fastmemcpy.h"
 #include "cpudetect.h"
+#include "libmpcodecs/vf.h"
 #include "libswscale/swscale.h"
 #include "libavutil/imgutils.h"
 #include "libmpcodecs/vf_scale.h"
@@ -246,11 +247,11 @@
     return draw_image(data);
   case VOCTRL_SET_EQUALIZER:
     {
-     va_list ap;
+     vf_equalizer_t *eq=data;
      short value;
      uint32_t luma,prev;
 
-     if ( strcmp( data,"brightness" ) && strcmp( data,"contrast" ) ) return VO_FALSE;
+     if ( strcmp( eq->item,"brightness" ) && strcmp( eq->item,"contrast" ) ) return VO_FALSE;
 
      if (ioctl(f,MGA_VID_GET_LUMA,&prev)) {
 	perror("Error in mga_vid_config ioctl()");
@@ -260,12 +261,8 @@
 
 //     printf("GET: 0x%4X 0x%4X  \n",(prev>>16),(prev&0xffff));
 
-     va_start(ap, data);
-     value = va_arg(ap, int);
-     va_end(ap);
-
-//     printf("value: %d -> ",value);
-     value=((value+100)*255)/200-128; // maps -100=>-128 and +100=>127
+//     printf("value: %d -> ",eq->value);
+     value=((eq->value+100)*255)/200-128; // maps -100=>-128 and +100=>127
 //     printf("%d  \n",value);
 
      if(!strcmp(data,"contrast"))
@@ -284,12 +281,11 @@
 
   case VOCTRL_GET_EQUALIZER:
     {
-     va_list ap;
-     int * value;
+     vf_equalizer_t *eq=data;
      short val;
      uint32_t luma;
 
-     if ( strcmp( data,"brightness" ) && strcmp( data,"contrast" ) ) return VO_FALSE;
+     if ( strcmp( eq->item,"brightness" ) && strcmp( eq->item,"contrast" ) ) return VO_FALSE;
 
      if (ioctl(f,MGA_VID_GET_LUMA,&luma)) {
 	perror("Error in mga_vid_config ioctl()");
@@ -297,16 +293,12 @@
 	return VO_FALSE;
      }
 
-     if ( !strcmp( data,"contrast" ) )
+     if ( !strcmp( eq->item,"contrast" ) )
 	 val=(luma & 0xFFFF);
      else
 	 val=(luma >> 16);
 
-     va_start(ap, data);
-     value = va_arg(ap, int*);
-     va_end(ap);
-
-     *value = (val*200)/255;
+     eq->value = (val*200)/255;
 
      return VO_TRUE;
     }
--- a/libvo/vo_aa.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_aa.c	Fri May 06 10:32:46 2011 +0000
@@ -36,6 +36,7 @@
 #include "config.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "aspect.h"
 #include "libswscale/swscale.h"
 #include "libmpcodecs/vf_scale.h"
@@ -731,31 +732,21 @@
   case VOCTRL_QUERY_FORMAT:
     return query_format(*((uint32_t*)data));
   case VOCTRL_SET_EQUALIZER: {
-    va_list ap;
-    int val;
+    vf_equalizer_t *eq=data;
 
-    va_start(ap, data);
-    val = va_arg(ap, int);
-    va_end(ap);
-
-    if(strcmp((char*)data,"contrast") == 0)
-      p->contrast = ( val + 100 ) * 64 / 100;
-    else if(strcmp((char*)data,"brightness") == 0)
-      p->bright = ( val + 100) * 128 / 100;
+    if(strcmp(eq->item,"contrast") == 0)
+      p->contrast = ( eq->value + 100 ) * 64 / 100;
+    else if(strcmp(eq->item,"brightness") == 0)
+      p->bright = ( eq->value + 100) * 128 / 100;
     return VO_TRUE;
   }
   case VOCTRL_GET_EQUALIZER: {
-    va_list ap;
-    int* val;
+    vf_equalizer_t *eq=data;
 
-    va_start(ap, data);
-    val = va_arg(ap, int*);
-    va_end(ap);
-
-    if(strcmp((char*)data,"contrast") == 0)
-      *val = (p->contrast - 64) * 100 / 64;
-    else if(strcmp((char*)data,"brightness") == 0)
-      *val = (p->bright - 128) * 100 / 128;
+    if(strcmp(eq->item,"contrast") == 0)
+      eq->value = (p->contrast - 64) * 100 / 64;
+    else if(strcmp(eq->item,"brightness") == 0)
+      eq->value = (p->bright - 128) * 100 / 128;
 
     return VO_TRUE;
   }
--- a/libvo/vo_cvidix.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_cvidix.c	Fri May 06 10:32:46 2011 +0000
@@ -173,24 +173,6 @@
     else vo_fs=1;
     setup_vidix();
     return VO_TRUE;
-  case VOCTRL_SET_EQUALIZER:
-    {
-      va_list ap;
-      int value;
-      va_start(ap, data);
-      value = va_arg(ap, int);
-      va_end(ap);
-      return vidix_control(request, data, value);
-    }
-  case VOCTRL_GET_EQUALIZER:
-    {
-      va_list ap;
-      int *value;
-      va_start(ap, data);
-      value = va_arg(ap, int *);
-      va_end(ap);
-      return vidix_control(request, data, value);
-    }
   }
   return vidix_control(request, data);
 }
--- a/libvo/vo_dfbmga.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_dfbmga.c	Fri May 06 10:32:46 2011 +0000
@@ -30,6 +30,7 @@
 #include "config.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "fastmemcpy.h"
 #include "sub/sub.h"
 #include "mp_msg.h"
@@ -1426,25 +1427,13 @@
 
      case VOCTRL_SET_EQUALIZER:
           {
-               va_list ap;
-               int value;
-
-               va_start( ap, data );
-               value = va_arg( ap, int );
-               va_end( ap );
-
-               return set_equalizer( data, value );
+               vf_equalizer_t *eq=data;
+               return set_equalizer( eq->item, eq->value );
           }
      case VOCTRL_GET_EQUALIZER:
           {
-               va_list ap;
-               int *value;
-
-               va_start( ap, data );
-               value = va_arg( ap, int* );
-               va_end( ap );
-
-               return get_equalizer( data, value );
+               vf_equalizer_t *eq=data;
+               return get_equalizer( eq->item, &eq->value );
           }
      }
 
--- a/libvo/vo_directfb2.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_directfb2.c	Fri May 06 10:32:46 2011 +0000
@@ -32,6 +32,7 @@
 #include "config.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "fastmemcpy.h"
 #include "sub/sub.h"
 #include "mp_msg.h"
@@ -1382,25 +1383,13 @@
 	return put_image(data);
     case VOCTRL_SET_EQUALIZER:
       {
-        va_list ap;
-	int value;
-
-        va_start(ap, data);
-	value = va_arg(ap, int);
-        va_end(ap);
-
-	return directfb_set_video_eq(data, value);
+        vf_equalizer_t *eq=data;
+	return directfb_set_video_eq(eq->item, eq->value);
       }
     case VOCTRL_GET_EQUALIZER:
       {
-	va_list ap;
-        int *value;
-
-        va_start(ap, data);
-        value = va_arg(ap, int*);
-        va_end(ap);
-
-	return directfb_get_video_eq(data, value);
+        vf_equalizer_t *eq=data;
+	return directfb_get_video_eq(eq->item, &eq->value);
       }
   };
   return VO_NOTIMPL;
--- a/libvo/vo_directx.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_directx.c	Fri May 06 10:32:46 2011 +0000
@@ -29,6 +29,7 @@
 #include "config.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "fastmemcpy.h"
 #include "input/input.h"
 #include "libmpcodecs/vd.h"
@@ -1566,22 +1567,12 @@
 		    return VO_TRUE;
 		}
 	case VOCTRL_SET_EQUALIZER: {
-		va_list	ap;
-		int	value;
-
-		va_start(ap, data);
-		value = va_arg(ap, int);
-		va_end(ap);
-		return color_ctrl_set(data, value);
+        vf_equalizer_t *eq=data;
+		return color_ctrl_set(eq->item, eq->value);
 	}
 	case VOCTRL_GET_EQUALIZER: {
-		va_list	ap;
-		int	*value;
-
-		va_start(ap, data);
-		value = va_arg(ap, int*);
-		va_end(ap);
-		return color_ctrl_get(data, value);
+        vf_equalizer_t *eq=data;
+		return color_ctrl_get(eq->item, &eq->value);
 	}
     case VOCTRL_UPDATE_SCREENINFO:
         if (vidmode) {
--- a/libvo/vo_dxr3.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_dxr3.c	Fri May 06 10:32:46 2011 +0000
@@ -41,6 +41,7 @@
 
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "aspect.h"
 #include "sub/spuenc.h"
 #include "sub/sub.h"
@@ -252,22 +253,17 @@
 	    }
 	case VOCTRL_SET_EQUALIZER:
 	    {
-		va_list ap;
-		int value;
+		vf_equalizer_t *eq=data;
 		em8300_bcs_t bcs;
 
-		va_start(ap, data);
-		value = va_arg(ap, int);
-		va_end(ap);
-
 		if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0)
 		    return VO_FALSE;
-		if (!strcasecmp(data, "brightness"))
-		    bcs.brightness = (value+100)*5;
-		else if (!strcasecmp(data, "contrast"))
-		    bcs.contrast = (value+100)*5;
-		else if (!strcasecmp(data, "saturation"))
-		    bcs.saturation = (value+100)*5;
+		if (!strcasecmp(eq->item, "brightness"))
+		    bcs.brightness = (eq->value+100)*5;
+		else if (!strcasecmp(eq->item, "contrast"))
+		    bcs.contrast = (eq->value+100)*5;
+		else if (!strcasecmp(eq->item, "saturation"))
+		    bcs.saturation = (eq->value+100)*5;
 		else return VO_FALSE;
 
 		if (ioctl(fd_control, EM8300_IOCTL_SETBCS, &bcs) < 0)
@@ -276,23 +272,18 @@
 	    }
 	case VOCTRL_GET_EQUALIZER:
 	    {
-		va_list ap;
-		int *value;
+		vf_equalizer_t *eq=data;
 		em8300_bcs_t bcs;
 
-		va_start(ap, data);
-		value = va_arg(ap, int*);
-		va_end(ap);
-
 		if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0)
 		    return VO_FALSE;
 
-		if (!strcasecmp(data, "brightness"))
-		    *value = (bcs.brightness/5)-100;
-		else if (!strcasecmp(data, "contrast"))
-		    *value = (bcs.contrast/5)-100;
-		else if (!strcasecmp(data, "saturation"))
-		    *value = (bcs.saturation/5)-100;
+		if (!strcasecmp(eq->item, "brightness"))
+		    eq->value = (bcs.brightness/5)-100;
+		else if (!strcasecmp(eq->item, "contrast"))
+		    eq->value = (bcs.contrast/5)-100;
+		else if (!strcasecmp(eq->item, "saturation"))
+		    eq->value = (bcs.saturation/5)-100;
 		else return VO_FALSE;
 
 		return VO_TRUE;
--- a/libvo/vo_fbdev.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_fbdev.c	Fri May 06 10:32:46 2011 +0000
@@ -1163,27 +1163,8 @@
     if (vidix_name) {
         switch (request) {
         case VOCTRL_SET_EQUALIZER:
-        {
-            va_list ap;
-            int value;
-
-            va_start(ap, data);
-            value = va_arg(ap, int);
-            va_end(ap);
-
-            return vidix_control(request, data, value);
-        }
         case VOCTRL_GET_EQUALIZER:
-        {
-            va_list ap;
-            int *value;
-
-            va_start(ap, data);
-            value = va_arg(ap, int*);
-            va_end(ap);
-
-            return vidix_control(request, data, value);
-        }
+            return vidix_control(request, data);
         }
     }
 #endif
--- a/libvo/vo_gl.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_gl.c	Fri May 06 10:32:46 2011 +0000
@@ -32,6 +32,7 @@
 #include "subopt-helper.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "sub/font_load.h"
 #include "sub/sub.h"
 
@@ -1361,34 +1362,26 @@
   case VOCTRL_GET_EQUALIZER:
     if (is_yuv) {
       int i;
-      va_list va;
-      int *value;
-      va_start(va, data);
-      value = va_arg(va, int *);
-      va_end(va);
+      vf_equalizer_t *eq=data;
       for (i = 0; eq_map[i].name; i++)
-        if (strcmp(data, eq_map[i].name) == 0) break;
+        if (strcmp(eq->item, eq_map[i].name) == 0) break;
       if (!(eq_map[i].supportmask & (1 << use_yuv)))
         break;
-      *value = *eq_map[i].value;
+      eq->value = *eq_map[i].value;
       return VO_TRUE;
     }
     break;
   case VOCTRL_SET_EQUALIZER:
     if (is_yuv) {
       int i;
-      va_list va;
-      int value;
-      va_start(va, data);
-      value = va_arg(va, int);
-      va_end(va);
+      vf_equalizer_t *eq=data;
       for (i = 0; eq_map[i].name; i++)
-        if (strcmp(data, eq_map[i].name) == 0) break;
+        if (strcmp(eq->item, eq_map[i].name) == 0) break;
       if (!(eq_map[i].supportmask & (1 << use_yuv)))
         break;
-      *eq_map[i].value = value;
+      *eq_map[i].value = eq->value;
       if (strcmp(data, "gamma") == 0)
-        eq_rgamma = eq_ggamma = eq_bgamma = value;
+        eq_rgamma = eq_ggamma = eq_bgamma = eq->value;
       update_yuvconv();
       return VO_TRUE;
     }
--- a/libvo/vo_gl2.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_gl2.c	Fri May 06 10:32:46 2011 +0000
@@ -29,6 +29,7 @@
 #include "subopt-helper.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "sub/sub.h"
 
 #include "gl_common.h"
@@ -915,23 +916,13 @@
 #ifdef CONFIG_GL_X11
     case VOCTRL_SET_EQUALIZER:
     {
-      va_list ap;
-      int value;
-
-      va_start(ap, data);
-      value = va_arg(ap, int);
-      va_end(ap);
-      return vo_x11_set_equalizer(data, value);
+      vf_equalizer_t *eq=data;
+      return vo_x11_set_equalizer(eq->item, eq->value);
     }
     case VOCTRL_GET_EQUALIZER:
     {
-      va_list ap;
-      int *value;
-
-      va_start(ap, data);
-      value = va_arg(ap, int *);
-      va_end(ap);
-      return vo_x11_get_equalizer(data, value);
+      vf_equalizer_t *eq=data;
+      return vo_x11_get_equalizer(eq->item, &eq->value);
     }
 #endif
     case VOCTRL_UPDATE_SCREENINFO:
--- a/libvo/vo_kva.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_kva.c	Fri May 06 10:32:46 2011 +0000
@@ -40,6 +40,7 @@
 #include "help_mp.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "aspect.h"
 
 #include "fastmemcpy.h"
@@ -965,26 +966,14 @@
 
     case VOCTRL_SET_EQUALIZER:
         {
-        va_list ap;
-        int     value;
-
-        va_start(ap, data);
-        value = va_arg(ap, int);
-        va_end(ap);
-
-        return color_ctrl_set(data, value);
+        vf_equalizer_t *eq=data;
+        return color_ctrl_set(eq->item, eq->value);
         }
 
     case VOCTRL_GET_EQUALIZER:
         {
-        va_list ap;
-        int     *value;
-
-        va_start(ap, data);
-        value = va_arg(ap, int *);
-        va_end(ap);
-
-        return color_ctrl_get(data, value);
+        vf_equalizer_t *eq=data;
+        return color_ctrl_get(eq->item, &eq->value);
         }
 
     case VOCTRL_UPDATE_SCREENINFO:
--- a/libvo/vo_matrixview.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_matrixview.c	Fri May 06 10:32:46 2011 +0000
@@ -30,6 +30,7 @@
 #include "subopt-helper.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "gl_common.h"
 #include "libswscale/swscale.h"
 #include "libmpcodecs/vf_scale.h"
@@ -296,29 +297,22 @@
         return VO_TRUE;
     case VOCTRL_GET_EQUALIZER:
         {
-            va_list va;
-            int *value;
-            va_start(va, data);
-            value = va_arg(va, int *);
-            va_end(va);
-            if (strcasecmp(data, "contrast") == 0) {
-                *value = eq_contrast;
-            } else if (strcasecmp(data, "brightness") == 0) {
-                *value = eq_brightness;
+            vf_equalizer_t *eq=data;
+
+            if (strcasecmp(eq->item, "contrast") == 0) {
+                eq->value = eq_contrast;
+            } else if (strcasecmp(eq->item, "brightness") == 0) {
+                eq->value = eq_brightness;
             }
         }
         return VO_TRUE;
     case VOCTRL_SET_EQUALIZER:
         {
-            va_list va;
-            int value;
-            va_start(va, data);
-            value = va_arg(va, int);
-            va_end(va);
-            if (strcasecmp(data, "contrast") == 0) {
-                contrast_set(value);
-            } else if (strcasecmp(data, "brightness") == 0) {
-                brightness_set(value);
+            vf_equalizer_t *eq=data;
+            if (strcasecmp(eq->item, "contrast") == 0) {
+                contrast_set(eq->value);
+            } else if (strcasecmp(eq->item, "brightness") == 0) {
+                brightness_set(eq->value);
             }
         }
         return VO_TRUE;
--- a/libvo/vo_svga.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_svga.c	Fri May 06 10:32:46 2011 +0000
@@ -366,30 +366,6 @@
 
 #ifdef CONFIG_VIDIX
     if (vidix_name[0]) {
-        switch (request) {
-            case VOCTRL_SET_EQUALIZER:
-            {
-                va_list ap;
-                int value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int);
-                va_end(ap);
-
-                return vidix_control(request, data, value);
-            }
-            case VOCTRL_GET_EQUALIZER:
-            {
-                va_list ap;
-                int *value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int*);
-                va_end(ap);
-
-                return vidix_control(request, data, value);
-            }
-        }
         return vidix_control(request, data);
     }
 #endif
--- a/libvo/vo_vdpau.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_vdpau.c	Fri May 06 10:32:46 2011 +0000
@@ -39,6 +39,7 @@
 #include "mp_msg.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "x11_common.h"
 #include "aspect.h"
 #include "sub/font_load.h"
@@ -1367,26 +1368,15 @@
         resize();
         return VO_TRUE;
     case VOCTRL_SET_EQUALIZER: {
-        va_list ap;
-        int value;
+        vf_equalizer_t *eq=data;
         if (image_format == IMGFMT_BGRA)
             return VO_NOTIMPL;
 
-        va_start(ap, data);
-        value = va_arg(ap, int);
-
-        va_end(ap);
-        return set_equalizer(data, value);
+        return set_equalizer(eq->item, eq->value);
     }
     case VOCTRL_GET_EQUALIZER: {
-        va_list ap;
-        int *value;
-
-        va_start(ap, data);
-        value = va_arg(ap, int *);
-
-        va_end(ap);
-        return get_equalizer(data, value);
+        vf_equalizer_t *eq=data;
+        return get_equalizer(eq->item, &eq->value);
     }
     case VOCTRL_ONTOP:
         vo_x11_ontop();
--- a/libvo/vo_vesa.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_vesa.c	Fri May 06 10:32:46 2011 +0000
@@ -1092,30 +1092,6 @@
 
 #ifdef CONFIG_VIDIX
   if (vidix_name) {
-    switch (request) {
-    case VOCTRL_SET_EQUALIZER:
-    {
-      va_list ap;
-      int value;
-
-      va_start(ap, data);
-      value = va_arg(ap, int);
-      va_end(ap);
-
-      return vidix_control(request, data, (int *)value);
-    }
-    case VOCTRL_GET_EQUALIZER:
-    {
-      va_list ap;
-      int *value;
-
-      va_start(ap, data);
-      value = va_arg(ap, int*);
-      va_end(ap);
-
-      return vidix_control(request, data, value);
-    }
-    }
     return vidix_control(request, data);
   }
 #endif
--- a/libvo/vo_winvidix.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_winvidix.c	Fri May 06 10:32:46 2011 +0000
@@ -338,28 +338,6 @@
     break;
   case VOCTRL_QUERY_FORMAT:
     return query_format(*((uint32_t*)data));
-  case VOCTRL_SET_EQUALIZER:
-  {
-    va_list ap;
-    int value;
-
-    va_start(ap, data);
-    value = va_arg(ap, int);
-    va_end(ap);
-
-    return vidix_control(request, data, (int *)value);
-  }
-  case VOCTRL_GET_EQUALIZER:
-  {
-    va_list ap;
-    int *value;
-
-    va_start(ap, data);
-    value = va_arg(ap, int*);
-    va_end(ap);
-
-    return vidix_control(request, data, value);
-  }
   }
   return vidix_control(request, data);
 //  return VO_NOTIMPL;
--- a/libvo/vo_x11.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_x11.c	Fri May 06 10:32:46 2011 +0000
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 #include "aspect.h"
 
 
@@ -674,25 +675,13 @@
             return VO_TRUE;
         case VOCTRL_SET_EQUALIZER:
             {
-                va_list ap;
-                int value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int);
-
-                va_end(ap);
-                return vo_x11_set_equalizer(data, value);
+                vf_equalizer_t *eq=data;
+                return vo_x11_set_equalizer(eq->item, &(eq->value));
             }
         case VOCTRL_GET_EQUALIZER:
             {
-                va_list ap;
-                int *value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int *);
-
-                va_end(ap);
-                return vo_x11_get_equalizer(data, value);
+                vf_equalizer_t *eq=data;
+                return vo_x11_get_equalizer(eq->item, &eq->value);
             }
         case VOCTRL_ONTOP:
             vo_x11_ontop();
--- a/libvo/vo_xv.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_xv.c	Fri May 06 10:32:46 2011 +0000
@@ -43,6 +43,7 @@
 #include "help_mp.h"
 #include "video_out.h"
 #include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
 
 
 #include <X11/Xlib.h>
@@ -757,27 +758,13 @@
             return VO_TRUE;
         case VOCTRL_SET_EQUALIZER:
             {
-                va_list ap;
-                int value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int);
-
-                va_end(ap);
-
-                return vo_xv_set_eq(xv_port, data, value);
+                vf_equalizer_t *eq=data;
+                return vo_xv_set_eq(xv_port, eq->item, eq->value);
             }
         case VOCTRL_GET_EQUALIZER:
             {
-                va_list ap;
-                int *value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int *);
-
-                va_end(ap);
-
-                return vo_xv_get_eq(xv_port, data, value);
+                vf_equalizer_t *eq=data;
+                return vo_xv_get_eq(xv_port, eq->item, &eq->value);
             }
         case VOCTRL_ONTOP:
             vo_x11_ontop();
--- a/libvo/vo_xvidix.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_xvidix.c	Fri May 06 10:32:46 2011 +0000
@@ -413,30 +413,6 @@
                 set_window(0);
             }
             return VO_TRUE;
-        case VOCTRL_SET_EQUALIZER:
-            {
-                va_list ap;
-                int value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int);
-
-                va_end(ap);
-
-                return vidix_control(request, data, value);
-            }
-        case VOCTRL_GET_EQUALIZER:
-            {
-                va_list ap;
-                int *value;
-
-                va_start(ap, data);
-                value = va_arg(ap, int *);
-
-                va_end(ap);
-
-                return vidix_control(request, data, value);
-            }
         case VOCTRL_UPDATE_SCREENINFO:
             aspect_save_screenres(vo_screenwidth, vo_screenheight);
             return VO_TRUE;
--- a/libvo/vo_xvmc.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vo_xvmc.c	Fri May 06 10:32:46 2011 +0000
@@ -26,6 +26,7 @@
 #include "video_out.h"
 #include "video_out_internal.h"
 #include "osdep/timer.h"
+#include "libmpcodecs/vf.h"
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -1332,26 +1333,14 @@
             return VO_TRUE;
         case VOCTRL_SET_EQUALIZER:
         {
-            va_list ap;
-            int value;
-
-            va_start(ap, data);
-            value = va_arg(ap, int);
-            va_end(ap);
-
-            return vo_xv_set_eq(xv_port, data, value);
+            vf_equalizer_t *eq=data;
+            return vo_xv_set_eq(xv_port, eq->item, eq->value);
         }
 
         case VOCTRL_GET_EQUALIZER:
         {
-            va_list ap;
-            int *value;
-
-            va_start(ap, data);
-            value = va_arg(ap, int*);
-            va_end(ap);
-
-            return vo_xv_get_eq(xv_port, data, value);
+            vf_equalizer_t *eq=data;
+            return vo_xv_get_eq(xv_port, eq->item, &eq->value);
         }
         case VOCTRL_UPDATE_SCREENINFO:
             update_xinerama_info();
--- a/libvo/vosub_vidix.c	Fri May 06 10:12:54 2011 +0000
+++ b/libvo/vosub_vidix.c	Fri May 06 10:32:46 2011 +0000
@@ -45,6 +45,7 @@
 #include "sub/sub.h"
 #include "vosub_vidix.h"
 
+#include "libmpcodecs/vf.h"
 #include "libmpcodecs/vfcap.h"
 #include "libmpcodecs/mp_image.h"
 
@@ -596,36 +597,32 @@
 	return VO_TRUE;
   case VOCTRL_SET_EQUALIZER:
   {
-    va_list ap;
-    int value;
+    vf_equalizer_t *eq=data;
     vidix_video_eq_t info;
 
     if(!video_on) return VO_FALSE;
-    va_start(ap, data);
-    value = va_arg(ap, int);
-    va_end(ap);
 
-//    printf("vidix seteq %s -> %d  \n",data,value);
+//    printf("vidix seteq %s -> %d  \n",eq->item,eq->value);
 
     /* vidix eq ranges are -1000..1000 */
-    if (!strcasecmp(data, "brightness"))
+    if (!strcasecmp(eq->item, "brightness"))
     {
-	info.brightness = value*10;
+	info.brightness = eq->value*10;
 	info.cap = VEQ_CAP_BRIGHTNESS;
     }
-    else if (!strcasecmp(data, "contrast"))
+    else if (!strcasecmp(eq->item, "contrast"))
     {
-	info.contrast = value*10;
+	info.contrast = eq->value*10;
 	info.cap = VEQ_CAP_CONTRAST;
     }
-    else if (!strcasecmp(data, "saturation"))
+    else if (!strcasecmp(eq->item, "saturation"))
     {
-	info.saturation = value*10;
+	info.saturation = eq->value*10;
 	info.cap = VEQ_CAP_SATURATION;
     }
-    else if (!strcasecmp(data, "hue"))
+    else if (!strcasecmp(eq->item, "hue"))
     {
-	info.hue = value*10;
+	info.hue = eq->value*10;
 	info.cap = VEQ_CAP_HUE;
     }
 
@@ -635,38 +632,33 @@
   }
   case VOCTRL_GET_EQUALIZER:
   {
-    va_list ap;
-    int *value;
+    vf_equalizer_t *eq=data;
     vidix_video_eq_t info;
 
     if(!video_on) return VO_FALSE;
     if (vdlPlaybackGetEq(vidix_handler, &info) != 0)
 	return VO_FALSE;
 
-    va_start(ap, data);
-    value = va_arg(ap, int*);
-    va_end(ap);
-
     /* vidix eq ranges are -1000..1000 */
-    if (!strcasecmp(data, "brightness"))
+    if (!strcasecmp(eq->item, "brightness"))
     {
 	if (info.cap & VEQ_CAP_BRIGHTNESS)
-	    *value = info.brightness/10;
+	    eq->value = info.brightness/10;
     }
-    else if (!strcasecmp(data, "contrast"))
+    else if (!strcasecmp(eq->item, "contrast"))
     {
 	if (info.cap & VEQ_CAP_CONTRAST)
-	    *value = info.contrast/10;
+	    eq->value = info.contrast/10;
     }
-    else if (!strcasecmp(data, "saturation"))
+    else if (!strcasecmp(eq->item, "saturation"))
     {
 	if (info.cap & VEQ_CAP_SATURATION)
-	    *value = info.saturation/10;
+	    eq->value = info.saturation/10;
     }
-    else if (!strcasecmp(data, "hue"))
+    else if (!strcasecmp(eq->item, "hue"))
     {
 	if (info.cap & VEQ_CAP_HUE)
-	    *value = info.hue/10;
+	    eq->value = info.hue/10;
     }
 
     return VO_TRUE;