mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
client API: fix timeout handling
(Again.) Fixed Lua timers as well.
This commit is contained in:
parent
0ad267c1d5
commit
93065af3ed
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user