summaryrefslogtreecommitdiffstats
path: root/libvo/mga_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/mga_common.c')
-rw-r--r--libvo/mga_common.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/libvo/mga_common.c b/libvo/mga_common.c
index 69c8f6322d..06d374f9fd 100644
--- a/libvo/mga_common.c
+++ b/libvo/mga_common.c
@@ -23,6 +23,7 @@
#include "libmpcodecs/vf_scale.h"
#include "mp_msg.h"
#include "help_mp.h"
+#include "old_vo_wrapper.h"
// mga_vid drawing functions
static void set_window( void ); /* forward declaration to kill warnings */
@@ -246,7 +247,7 @@ static void mga_fullscreen(void)
}
#endif
-static int control(uint32_t request, void *data, ...)
+static int control(uint32_t request, void *data)
{
switch (request) {
case VOCTRL_QUERY_FORMAT:
@@ -257,11 +258,12 @@ static int control(uint32_t request, void *data, ...)
return draw_image(data);
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
short value;
uint32_t luma,prev;
+ struct voctrl_set_equalizer_args *args = data;
- if ( strcmp( data,"brightness" ) && strcmp( data,"contrast" ) ) return VO_FALSE;
+ if (strcmp(args->name, "brightness") && strcmp(args->name, "contrast"))
+ return VO_FALSE;
if (ioctl(f,MGA_VID_GET_LUMA,&prev)) {
perror("Error in mga_vid_config ioctl()");
@@ -271,15 +273,13 @@ static int control(uint32_t request, void *data, ...)
// printf("GET: 0x%4X 0x%4X \n",(prev>>16),(prev&0xffff));
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
+ value = args->value;
// printf("value: %d -> ",value);
value=((value+100)*255)/200-128; // maps -100=>-128 and +100=>127
// printf("%d \n",value);
- if(!strcmp(data,"contrast"))
+ if (!strcmp(args->name, "contrast"))
luma = (prev&0xFFFF0000)|(value&0xFFFF);
else
luma = (prev&0xFFFF)|(value<<16);
@@ -295,12 +295,12 @@ static int control(uint32_t request, void *data, ...)
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int * value;
short val;
uint32_t luma;
+ struct voctrl_get_equalizer_args *args = data;
- if ( strcmp( data,"brightness" ) && strcmp( data,"contrast" ) ) return VO_FALSE;
+ if (strcmp(args->name, "brightness") && strcmp(args->name, "contrast"))
+ return VO_FALSE;
if (ioctl(f,MGA_VID_GET_LUMA,&luma)) {
perror("Error in mga_vid_config ioctl()");
@@ -308,16 +308,12 @@ static int control(uint32_t request, void *data, ...)
return VO_FALSE;
}
- if ( !strcmp( data,"contrast" ) )
+ if (!strcmp(args->name, "contrast"))
val=(luma & 0xFFFF);
else
val=(luma >> 16);
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- *value = (val*200)/255;
+ *args->valueptr = (val*200)/255;
return VO_TRUE;
}