From d815584755c8c75ac6bc3fb8a7465836b4dbcd42 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 23 May 2023 15:06:18 +0200 Subject: [PATCH] lavif/vf_libplacebo: move code (cosmetic) To eliminate need for forward declaration --- libavfilter/vf_libplacebo.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index abf22a6117..d4b2f21328 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -317,23 +317,6 @@ static void set_gamut_mode(struct pl_color_map_params *p, int gamut_mode) av_assert0(0); }; -static int update_settings(AVFilterContext *ctx); - -static int parse_shader(AVFilterContext *avctx, const void *shader, size_t len) -{ - LibplaceboContext *s = avctx->priv; - const struct pl_hook *hook; - - hook = pl_mpv_user_shader_parse(s->gpu, shader, len); - if (!hook) { - av_log(s, AV_LOG_ERROR, "Failed parsing custom shader!\n"); - return AVERROR(EINVAL); - } - - s->hooks[s->num_hooks++] = hook; - return update_settings(avctx); -} - static int find_scaler(AVFilterContext *avctx, const struct pl_filter_config **opt, const char *name, int frame_mixing) @@ -487,6 +470,21 @@ fail: return err; } +static int parse_shader(AVFilterContext *avctx, const void *shader, size_t len) +{ + LibplaceboContext *s = avctx->priv; + const struct pl_hook *hook; + + hook = pl_mpv_user_shader_parse(s->gpu, shader, len); + if (!hook) { + av_log(s, AV_LOG_ERROR, "Failed parsing custom shader!\n"); + return AVERROR(EINVAL); + } + + s->hooks[s->num_hooks++] = hook; + return update_settings(avctx); +} + static void libplacebo_uninit(AVFilterContext *avctx); static int libplacebo_init(AVFilterContext *avctx)