From 1c550326ce5a885ef58fee9e1d11c9faab4a13b9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Apr 2018 20:37:56 +0200 Subject: vo_libmpv: move up update() function Avoids a forward declaration. --- video/out/vo_libmpv.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'video') diff --git a/video/out/vo_libmpv.c b/video/out/vo_libmpv.c index 838c6ac86d..778de778f5 100644 --- a/video/out/vo_libmpv.c +++ b/video/out/vo_libmpv.c @@ -106,13 +106,23 @@ struct mpv_render_context { struct mp_vo_opts *vo_opts; }; -static void update(struct mpv_render_context *ctx); - const struct render_backend_fns *render_backends[] = { &render_backend_gpu, NULL }; +static void update(struct mpv_render_context *ctx) +{ + pthread_mutex_lock(&ctx->update_lock); + if (ctx->update_cb) + ctx->update_cb(ctx->update_cb_ctx); + + // For the termination code. + ctx->had_kill_update = true; + pthread_cond_broadcast(&ctx->update_cond); + pthread_mutex_unlock(&ctx->update_lock); +} + void *get_mpv_render_param(mpv_render_param *params, mpv_render_param_type type, void *def) { @@ -428,18 +438,6 @@ int mpv_render_context_set_parameter(mpv_render_context *ctx, return err; } -static void update(struct mpv_render_context *ctx) -{ - pthread_mutex_lock(&ctx->update_lock); - if (ctx->update_cb) - ctx->update_cb(ctx->update_cb_ctx); - - // For the termination code. - ctx->had_kill_update = true; - pthread_cond_broadcast(&ctx->update_cond); - pthread_mutex_unlock(&ctx->update_lock); -} - static void draw_frame(struct vo *vo, struct vo_frame *frame) { struct vo_priv *p = vo->priv; -- cgit v1.2.3