diff options
author | wm4 <wm4@nowhere> | 2015-05-11 23:44:36 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-11 23:44:36 +0200 |
commit | 92b9d75d7256be71d8c8b18438af9494b78f0e96 (patch) | |
tree | eaf114423ce898dc5ac77f5fa48c3f13ef699c41 /player/client.c | |
parent | ca9964a4fb6b1faa0155da43b3c815db0075e2d5 (diff) | |
download | mpv-92b9d75d7256be71d8c8b18438af9494b78f0e96.tar.bz2 mpv-92b9d75d7256be71d8c8b18438af9494b78f0e96.tar.xz |
threads: use utility+POSIX functions instead of weird wrappers
There is not much of a reason to have these wrappers around. Use POSIX
standard functions directly, and use a separate utility function to take
care of the timespec calculations. (Course POSIX for using this weird
format for time values.)
Diffstat (limited to 'player/client.c')
-rw-r--r-- | player/client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/player/client.c b/player/client.c index 4fba2912e7..afc4f32a68 100644 --- a/player/client.c +++ b/player/client.c @@ -284,8 +284,10 @@ static int wait_wakeup(struct mpv_handle *ctx, int64_t end) int r = 0; pthread_mutex_unlock(&ctx->lock); pthread_mutex_lock(&ctx->wakeup_lock); - if (!ctx->need_wakeup) - r = mpthread_cond_timedwait(&ctx->wakeup, &ctx->wakeup_lock, end); + if (!ctx->need_wakeup) { + struct timespec ts = mp_time_us_to_timespec(end); + r = pthread_cond_timedwait(&ctx->wakeup, &ctx->wakeup_lock, &ts); + } if (r == 0) ctx->need_wakeup = false; pthread_mutex_unlock(&ctx->wakeup_lock); |