summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-11 23:44:36 +0200
committerwm4 <wm4@nowhere>2015-05-11 23:44:36 +0200
commit92b9d75d7256be71d8c8b18438af9494b78f0e96 (patch)
treeeaf114423ce898dc5ac77f5fa48c3f13ef699c41 /video
parentca9964a4fb6b1faa0155da43b3c815db0075e2d5 (diff)
downloadmpv-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 'video')
-rw-r--r--video/out/vo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 0b197763a0..be9f8a3088 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -471,8 +471,10 @@ static void wait_vo(struct vo *vo, int64_t until_time)
pthread_mutex_unlock(&in->lock);
} else {
pthread_mutex_lock(&in->lock);
- if (!in->need_wakeup)
- mpthread_cond_timedwait(&in->wakeup, &in->lock, until_time);
+ if (!in->need_wakeup) {
+ struct timespec ts = mp_time_us_to_timespec(until_time);
+ pthread_cond_timedwait(&in->wakeup, &in->lock, &ts);
+ }
in->need_wakeup = false;
pthread_mutex_unlock(&in->lock);
}