diff options
author | wm4 <wm4@nowhere> | 2016-01-15 22:49:10 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-15 22:54:08 +0100 |
commit | 31adc87bde5d7d671b9b52cd912875d037501a1c (patch) | |
tree | 50294d4de8f6ff5524f238697bb3cd597cd710e8 /player/client.c | |
parent | 2d4e8b623d5e6b540fba67cf46ebcfbf8c148ebf (diff) | |
download | mpv-31adc87bde5d7d671b9b52cd912875d037501a1c.tar.bz2 mpv-31adc87bde5d7d671b9b52cd912875d037501a1c.tar.xz |
global: add client API pointer to library handle
Makes the next commit simpler. It's probably a bad idea to add more
fields to the global state, but on the other hand the client API state
is pretty much per-instance anyway. It also will help with things like
the proposed libmpv custom stream API.
Diffstat (limited to 'player/client.c')
-rw-r--r-- | player/client.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/player/client.c b/player/client.c index f4758f653c..3abc8d8086 100644 --- a/player/client.c +++ b/player/client.c @@ -21,6 +21,7 @@ #include <assert.h> #include "common/common.h" +#include "common/global.h" #include "common/msg.h" #include "common/msg_control.h" #include "input/input.h" @@ -137,6 +138,7 @@ void mp_clients_init(struct MPContext *mpctx) *mpctx->clients = (struct mp_client_api) { .mpctx = mpctx, }; + mpctx->global->client_api = mpctx->clients; pthread_mutex_init(&mpctx->clients->lock, NULL); } @@ -264,6 +266,11 @@ struct MPContext *mp_client_get_core(struct mpv_handle *ctx) return ctx->mpctx; } +struct MPContext *mp_client_api_get_core(struct mp_client_api *api) +{ + return api->mpctx; +} + static void wakeup_client(struct mpv_handle *ctx) { pthread_mutex_lock(&ctx->wakeup_lock); |