diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 26d11583dd..7c867cf27d 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -77,11 +77,15 @@ void set_video_quality(sh_video_t *sh_video,int quality){ int set_video_colors(sh_video_t *sh_video,char *item,int value) { vf_instance_t* vf=sh_video->vfilter; + vf_equalizer_t data; + + data.item = item; + data.value = value; mp_dbg(MSGT_DECVIDEO,MSGL_V,"set video colors %s=%d \n", item, value); if (vf) { - int ret = vf->control(vf, VFCTRL_SET_EQUALIZER, item, (int *)value); + int ret = vf->control(vf, VFCTRL_SET_EQUALIZER, &data); if (ret == CONTROL_TRUE) return(1); } @@ -96,13 +100,18 @@ int set_video_colors(sh_video_t *sh_video,char *item,int value) int get_video_colors(sh_video_t *sh_video,char *item,int *value) { vf_instance_t* vf=sh_video->vfilter; + vf_equalizer_t data; + + data.item = item; mp_dbg(MSGT_DECVIDEO,MSGL_V,"get video colors %s \n", item); if (vf) { - int ret = vf->control(vf, VFCTRL_GET_EQUALIZER, item, value); - if (ret == CONTROL_TRUE) + int ret = vf->control(vf, VFCTRL_GET_EQUALIZER, &data); + if (ret == CONTROL_TRUE){ + *value = data.value; return(1); + } } /* try software control */ if(mpvdec) return mpvdec->control(sh_video,VDCTRL_GET_EQUALIZER, item, value); diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h index bca3451c1c..a8a2f5232f 100644 --- a/libmpcodecs/vf.h +++ b/libmpcodecs/vf.h @@ -24,7 +24,7 @@ typedef struct vf_instance_s { int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt); int (*control)(struct vf_instance_s* vf, - int request, void* data, ...); + int request, void* data); int (*query_format)(struct vf_instance_s* vf, unsigned int fmt); void (*get_image)(struct vf_instance_s* vf, @@ -46,6 +46,12 @@ typedef struct vf_instance_s { // control codes: #include "mpc_info.h" +typedef struct vf_seteq_s +{ + char *item; + int value; +} vf_equalizer_t; + #define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */ #define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */ #define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */ diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index e82b85b668..024894d9c7 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "../config.h" #include "../mp_msg.h" @@ -47,7 +46,7 @@ static int config(struct vf_instance_s* vf, return 1; } -static int control(struct vf_instance_s* vf, int request, void* data, ...) +static int control(struct vf_instance_s* vf, int request, void* data) { switch(request){ #ifdef USE_OSD @@ -58,25 +57,15 @@ static int control(struct vf_instance_s* vf, int request, void* data, ...) #endif case VFCTRL_SET_EQUALIZER: { - va_list ap; - int value; - + vf_equalizer_t *eq=data; if(!vo_config_count) return CONTROL_FALSE; // vo not configured? - va_start(ap, data); - value = va_arg(ap, int); - va_end(ap); - return((video_out->control(VOCTRL_SET_EQUALIZER, data, (int *)value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE); + return((video_out->control(VOCTRL_SET_EQUALIZER, eq->item, eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE); } case VFCTRL_GET_EQUALIZER: { - va_list ap; - int *value; - + vf_equalizer_t *eq=data; if(!vo_config_count) return CONTROL_FALSE; // vo not configured? - va_start(ap, data); - value = va_arg(ap, int); - va_end(ap); - return((video_out->control(VOCTRL_GET_EQUALIZER, data, value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE); + return((video_out->control(VOCTRL_GET_EQUALIZER, eq->item, &eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE); } } // return video_out->control(request,data);