diff options
author | wm4 <wm4@nowhere> | 2015-12-02 23:08:39 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-02 23:08:43 +0100 |
commit | 57e691b9011e9bdcc4fbc53a484f80057c65a891 (patch) | |
tree | f6c6bdabbf660b6e65ffe7364afa602aefc26716 /player | |
parent | 344d44681efaf180e7bd2e523f2add547b451bec (diff) | |
download | mpv-57e691b9011e9bdcc4fbc53a484f80057c65a891.tar.bz2 mpv-57e691b9011e9bdcc4fbc53a484f80057c65a891.tar.xz |
client API: disallow masking MPV_EVENT_SHUTDOWN
This makes no sense, because the client is obligated to react to this
event.
This also happens to fix a deadlock with JSON IPC clients sending
"disable_event all", because MPV_EVENT_SHUTDOWN was used to stop the
thread driving the socket connection (fixes #2558).
Diffstat (limited to 'player')
-rw-r--r-- | player/client.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/player/client.c b/player/client.c index b1dd8d3c55..f4758f653c 100644 --- a/player/client.c +++ b/player/client.c @@ -711,6 +711,8 @@ int mpv_request_event(mpv_handle *ctx, mpv_event_id event, int enable) { if (!mpv_event_name(event) || enable < 0 || enable > 1) return MPV_ERROR_INVALID_PARAMETER; + if (event == MPV_EVENT_SHUTDOWN && !enable) + return MPV_ERROR_INVALID_PARAMETER; assert(event < (int)INTERNAL_EVENT_BASE); // excluded above; they have no name pthread_mutex_lock(&ctx->lock); uint64_t bit = 1ULL << event; |