Mercurial > mplayer.hg
diff libvo/vo_matrixview.c @ 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 | f8939d5b14b5 |
children | ddb45e9443ec |
line wrap: on
line diff
--- 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;