diff options
-rw-r--r-- | player/client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/player/client.c b/player/client.c index 824389335d..675410893d 100644 --- a/player/client.c +++ b/player/client.c @@ -13,6 +13,7 @@ #include <stddef.h> #include <stdlib.h> +#include <errno.h> #include <assert.h> #include "common/common.h" @@ -452,7 +453,9 @@ mpv_event *mpv_wait_event(mpv_handle *ctx, double timeout) break; if (timeout <= 0) break; - pthread_cond_timedwait(&ctx->wakeup, &ctx->lock, &deadline); + int r = pthread_cond_timedwait(&ctx->wakeup, &ctx->lock, &deadline); + if (r == ETIMEDOUT) + break; } ctx->queued_wakeup = false; |