From b8ade7c99b830ee9870040bcfc1f2c3d3a64d172 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 16 Sep 2016 14:23:54 +0200 Subject: player, ao, vo: don't call mp_input_wakeup() directly Currently, calling mp_input_wakeup() will wake up the core thread (also called the playloop). This seems odd, but currently the core indeed calls mp_input_wait() when it has nothing more to do. It's done this way because MPlayer used input_ctx as central "mainloop". This is probably going to change. Remove direct calls to this function, and replace it with mp_wakeup_core() calls. ao and vo are changed to use opaque callbacks and not use input_ctx for this purpose. Other code already uses opaque callbacks, or has legitimate reasons to use input_ctx directly (such as sending actual user input). --- player/client.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'player/client.c') diff --git a/player/client.c b/player/client.c index 803ef36fca..807fab5df6 100644 --- a/player/client.c +++ b/player/client.c @@ -424,8 +424,7 @@ void mpv_detach_destroy(mpv_handle *ctx) ctx = NULL; // shutdown_clients() sleeps to avoid wasting CPU. // mp_hook_test_completion() also relies on this a bit. - if (clients->mpctx->input) - mp_input_wakeup(clients->mpctx->input); + mp_wakeup_core(clients->mpctx); break; } } @@ -759,8 +758,8 @@ mpv_event *mpv_wait_event(mpv_handle *ctx, double timeout) pthread_mutex_lock(&ctx->lock); - if (!ctx->fuzzy_initialized && ctx->clients->mpctx->input) - mp_input_wakeup(ctx->clients->mpctx->input); + if (!ctx->fuzzy_initialized) + mp_wakeup_core(ctx->clients->mpctx); ctx->fuzzy_initialized = true; if (timeout < 0) -- cgit v1.2.3