vf: remove unnecessary indirection

This commit is contained in:
wm4 2013-07-21 19:23:32 +02:00
parent 644451f4d9
commit c50d5376f2
2 changed files with 5 additions and 26 deletions

View File

@ -209,10 +209,8 @@ void vf_print_filter_chain(int msglevel, struct vf_instance *vf)
}
}
struct vf_instance *vf_open_plugin_noerr(struct MPOpts *opts,
const vf_info_t *const *filter_list,
vf_instance_t *next, const char *name,
char **args, int *retcode)
static struct vf_instance *vf_open(struct MPOpts *opts, vf_instance_t *next,
const char *name, char **args)
{
vf_instance_t *vf;
int i;
@ -247,26 +245,13 @@ struct vf_instance *vf_open_plugin_noerr(struct MPOpts *opts,
args = (char **)args[1];
else
args = NULL;
*retcode = vf->info->vf_open(vf, (char *)args);
if (*retcode > 0)
int retcode = vf->info->vf_open(vf, (char *)args);
if (retcode > 0)
return vf;
talloc_free(vf);
return NULL;
}
struct vf_instance *vf_open_plugin(struct MPOpts *opts,
const vf_info_t *const *filter_list,
vf_instance_t *next, const char *name,
char **args)
{
struct vf_instance *vf = vf_open_plugin_noerr(opts, filter_list, next,
name, args, &(int){0});
if (!vf)
mp_tmsg(MSGT_VFILTER, MSGL_ERR, "Couldn't open video filter '%s'.\n",
name);
return vf;
}
vf_instance_t *vf_open_filter(struct MPOpts *opts, vf_instance_t *next,
const char *name, char **args)
{
@ -292,7 +277,7 @@ vf_instance_t *vf_open_filter(struct MPOpts *opts, vf_instance_t *next,
mp_msg(MSGT_VFILTER, MSGL_INFO, "%s[%s]\n",
mp_gtext("Opening video filter: "), name);
}
return vf_open_plugin(opts, filter_list, next, name, args);
return vf_open(opts, next, name, args);
}
/**

View File

@ -119,12 +119,6 @@ int vf_filter_frame(struct vf_instance *vf, struct mp_image *img);
struct mp_image *vf_chain_output_queued_frame(struct vf_instance *vf);
void vf_chain_seek_reset(struct vf_instance *vf);
vf_instance_t *vf_open_plugin(struct MPOpts *opts,
const vf_info_t * const *filter_list, vf_instance_t *next,
const char *name, char **args);
struct vf_instance *vf_open_plugin_noerr(struct MPOpts *opts,
const vf_info_t *const *filter_list, vf_instance_t *next,
const char *name, char **args, int *retcode);
vf_instance_t *vf_open_filter(struct MPOpts *opts, vf_instance_t *next,
const char *name, char **args);
vf_instance_t *vf_add_before_vo(vf_instance_t **vf, char *name, char **args);