From c50d5376f214b8dc319206a2ce5a953ed04378f6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 21 Jul 2013 19:23:32 +0200 Subject: [PATCH] vf: remove unnecessary indirection --- video/filter/vf.c | 25 +++++-------------------- video/filter/vf.h | 6 ------ 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/video/filter/vf.c b/video/filter/vf.c index eaa19bbdb8..c9fd80bceb 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -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); } /** diff --git a/video/filter/vf.h b/video/filter/vf.h index be1243e3a4..b47f44a7ca 100644 --- a/video/filter/vf.h +++ b/video/filter/vf.h @@ -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);