mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-29 07:06:59 +08:00
client API: fix timeout handling
(Again.) Fixed Lua timers as well.
This commit is contained in:
+4
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user