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_gl.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_gl.c')
-rw-r--r-- | libvo/vo_gl.c | 76 |
1 files changed, 34 insertions, 42 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 500bb0d8bb..36fbff4186 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -941,35 +941,31 @@ static int control(uint32_t request, void *data, ...) return VO_TRUE; case VOCTRL_GET_EQUALIZER: if (image_format == IMGFMT_YV12) { - va_list va; - int *value; - va_start(va, data); - value = va_arg(va, int *); - va_end(va); - if (strcasecmp(data, "brightness") == 0) { - *value = eq_bri; + struct voctrl_get_equalizer_args *args = data; + if (strcasecmp(args->name, "brightness") == 0) { + *args->valueptr = eq_bri; if (use_yuv == YUV_CONVERSION_COMBINERS) break; // not supported - } else if (strcasecmp(data, "contrast") == 0) { - *value = eq_cont; + } else if (strcasecmp(args->name, "contrast") == 0) { + *args->valueptr = eq_cont; if (use_yuv == YUV_CONVERSION_COMBINERS) break; // not supported - } else if (strcasecmp(data, "saturation") == 0) { - *value = eq_sat; - } else if (strcasecmp(data, "hue") == 0) { - *value = eq_hue; - } else if (strcasecmp(data, "gamma") == 0) { - *value = eq_rgamma; + } else if (strcasecmp(args->name, "saturation") == 0) { + *args->valueptr = eq_sat; + } else if (strcasecmp(args->name, "hue") == 0) { + *args->valueptr = eq_hue; + } else if (strcasecmp(args->name, "gamma") == 0) { + *args->valueptr = eq_rgamma; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported - } else if (strcasecmp(data, "red_gamma") == 0) { - *value = eq_rgamma; + } else if (strcasecmp(args->name, "red_gamma") == 0) { + *args->valueptr = eq_rgamma; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported - } else if (strcasecmp(data, "green_gamma") == 0) { - *value = eq_ggamma; + } else if (strcasecmp(args->name, "green_gamma") == 0) { + *args->valueptr = eq_ggamma; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported - } else if (strcasecmp(data, "blue_gamma") == 0) { - *value = eq_bgamma; + } else if (strcasecmp(args->name, "blue_gamma") == 0) { + *args->valueptr = eq_bgamma; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported } @@ -978,35 +974,31 @@ static int control(uint32_t request, void *data, ...) break; case VOCTRL_SET_EQUALIZER: if (image_format == IMGFMT_YV12) { - va_list va; - int value; - va_start(va, data); - value = va_arg(va, int); - va_end(va); - if (strcasecmp(data, "brightness") == 0) { - eq_bri = value; + struct voctrl_set_equalizer_args *args = data; + if (strcasecmp(args->name, "brightness") == 0) { + eq_bri = args->value; if (use_yuv == YUV_CONVERSION_COMBINERS) break; // not supported - } else if (strcasecmp(data, "contrast") == 0) { - eq_cont = value; + } else if (strcasecmp(args->name, "contrast") == 0) { + eq_cont = args->value; if (use_yuv == YUV_CONVERSION_COMBINERS) break; // not supported - } else if (strcasecmp(data, "saturation") == 0) { - eq_sat = value; - } else if (strcasecmp(data, "hue") == 0) { - eq_hue = value; - } else if (strcasecmp(data, "gamma") == 0) { - eq_rgamma = eq_ggamma = eq_bgamma = value; + } else if (strcasecmp(args->name, "saturation") == 0) { + eq_sat = args->value; + } else if (strcasecmp(args->name, "hue") == 0) { + eq_hue = args->value; + } else if (strcasecmp(args->name, "gamma") == 0) { + eq_rgamma = eq_ggamma = eq_bgamma = args->value; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported - } else if (strcasecmp(data, "red_gamma") == 0) { - eq_rgamma = value; + } else if (strcasecmp(args->name, "red_gamma") == 0) { + eq_rgamma = args->value; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported - } else if (strcasecmp(data, "green_gamma") == 0) { - eq_ggamma = value; + } else if (strcasecmp(args->name, "green_gamma") == 0) { + eq_ggamma = args->value; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported - } else if (strcasecmp(data, "blue_gamma") == 0) { - eq_bgamma = value; + } else if (strcasecmp(args->name, "blue_gamma") == 0) { + eq_bgamma = args->value; if (use_yuv == YUV_CONVERSION_COMBINERS || use_yuv == YUV_CONVERSION_FRAGMENT) break; // not supported } |