summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-16 20:30:25 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-16 22:47:39 +0300
commitc2a24323bca735e68b002622c1083157f4efdf0c (patch)
tree51fd5a0f2c5bddc99c855aa544ee2904afa2c580
parent028e51d8afcaba20d6b0743fbe39795cf2e0015d (diff)
downloadmpv-c2a24323bca735e68b002622c1083157f4efdf0c.tar.bz2
mpv-c2a24323bca735e68b002622c1083157f4efdf0c.tar.xz
client API: make sure to send IDLE event after mpv_initialize()
This was slightly broken: since mp_initialize() did not necessarily interrupt core_thread() (which is waiting for initialization), it did not enter mp_play_files(), which would have sent an IDLE event. I suppose that in some cases (like with mpv-android), the initial IDLE event was never actually sent, because the first wakeup of the core thread happens with the "loadfile" command, which will disallow the core thread an IDLE event.
-rw-r--r--player/client.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/client.c b/player/client.c
index edd929c203..247f580498 100644
--- a/player/client.c
+++ b/player/client.c
@@ -578,6 +578,7 @@ int mpv_initialize(mpv_handle *ctx)
{
lock_core(ctx);
int res = mp_initialize(ctx->mpctx, NULL) ? MPV_ERROR_INVALID_PARAMETER : 0;
+ mp_wakeup_core(ctx->mpctx);
unlock_core(ctx);
return res;
}