diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-02 18:51:38 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-23 13:41:03 +0300 |
commit | dbe080ec9f05cd216f4217c81409a37d3f4db969 (patch) | |
tree | 48861e98ea8a195781e314b7b96923509c35b0f1 /libvo/vo_aa.c | |
parent | 530df550e4af63fce126001c5509d931d9ee65f9 (diff) | |
download | mpv-dbe080ec9f05cd216f4217c81409a37d3f4db969.tar.bz2 mpv-dbe080ec9f05cd216f4217c81409a37d3f4db969.tar.xz |
Change VOCTRL_[GET|SET]_EQUALIZER argument passing
These were the only voctrl types with more than one argument. The
second argument was passed using variable arguments. Change them to
use a single argument (address of a struct containing both old
arguments). This makes forwarding the arguments to other functions
easier and allows simplifying code.
Diffstat (limited to 'libvo/vo_aa.c')
-rw-r--r-- | libvo/vo_aa.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c index 77c545bbb6..8ba01d6569 100644 --- a/libvo/vo_aa.c +++ b/libvo/vo_aa.c @@ -724,31 +724,20 @@ static int control(uint32_t request, void *data, ...) case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); case VOCTRL_SET_EQUALIZER: { - va_list ap; - int val; - - 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; + struct voctrl_set_equalizer_args *args = data; + if (strcmp(args->name, "contrast") == 0) + p->contrast = (args->value + 100) * 64 / 100; + else if (strcmp(args->name, "brightness") == 0) + p->bright = (args->value + 100) * 128 / 100; return VO_TRUE; } case VOCTRL_GET_EQUALIZER: { - va_list ap; - int* val; - - va_start(ap, data); - val = va_arg(ap, int*); - va_end(ap); + struct voctrl_get_equalizer_args *args = data; - 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(args->name, "contrast") == 0) + *args->valueptr = (p->contrast - 64) * 100 / 64; + else if (strcmp(args->name, "brightness") == 0) + *args->valueptr = (p->bright - 128) * 100 / 128; return VO_TRUE; } |