From 2edf00fb94ba18dc2d476e0354036043ce4f714d Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 9 Mar 2018 11:53:48 +0100 Subject: client API: send MPV_EVENT_SHUTDOWN only once Before this change, mpv_wait_event() could inconsistently return multiple MPV_EVENT_SHUTDOWN events to a single mpv_handle, up to the point of spamming the event queue under certain circumstances. Change this and just send it exactly once to each mpv_handle. Some client API users might have weird requirements about destroying their state asynchronously (and not reacting immediately to the SHUTDOWN event). This change will help a bit to make this less weird and surprising. --- libmpv/client.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libmpv') diff --git a/libmpv/client.h b/libmpv/client.h index acdac45dc5..1483f1afd6 100644 --- a/libmpv/client.h +++ b/libmpv/client.h @@ -1166,9 +1166,8 @@ typedef enum mpv_event_id { /** * Happens when the player quits. The player enters a state where it tries * to disconnect all clients. Most requests to the player will fail, and - * mpv_wait_event() will always return instantly (returning new shutdown - * events if no other events are queued). The client should react to this - * and quit with mpv_destroy() as soon as possible. + * the client should react to this and quit with mpv_destroy() as soon as + * possible. */ MPV_EVENT_SHUTDOWN = 1, /** -- cgit v1.2.3