summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-20 20:37:56 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-29 02:21:32 +0300
commit1c550326ce5a885ef58fee9e1d11c9faab4a13b9 (patch)
tree7383a931e3d9dacb3e98bfc5d56b3c3bb98d8ead
parent9825bbb8cf5090bbc9bd652687f2f196de54e7f7 (diff)
downloadmpv-1c550326ce5a885ef58fee9e1d11c9faab4a13b9.tar.bz2
mpv-1c550326ce5a885ef58fee9e1d11c9faab4a13b9.tar.xz
vo_libmpv: move up update() function
Avoids a forward declaration.
-rw-r--r--video/out/vo_libmpv.c26
1 files changed, 12 insertions, 14 deletions
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;