diff options
author | wm4 <wm4@nowhere> | 2014-03-01 00:38:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-01 00:38:17 +0100 |
commit | 93065af3edb60fef45f693152e14a10e7d2cce1b (patch) | |
tree | 4eaae78d7114207b028b414a5259c504d2a29a97 /player | |
parent | 0ad267c1d5f27a74f70d49e89a2a2bede77f9ff6 (diff) | |
download | mpv-93065af3edb60fef45f693152e14a10e7d2cce1b.tar.bz2 mpv-93065af3edb60fef45f693152e14a10e7d2cce1b.tar.xz |
client API: fix timeout handling
(Again.)
Fixed Lua timers as well.
Diffstat (limited to 'player')
-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; |