summaryrefslogtreecommitdiffstats
path: root/audio/out/push.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/push.c')
-rw-r--r--audio/out/push.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/audio/out/push.c b/audio/out/push.c
index 8e3d2f87b0..beafd36a13 100644
--- a/audio/out/push.c
+++ b/audio/out/push.c
@@ -340,7 +340,8 @@ static void *playthread(void *arg)
pthread_cond_signal(&p->wakeup); // for draining
if (p->still_playing && timeout > 0) {
- mpthread_cond_timedwait_rel(&p->wakeup, &p->lock, timeout);
+ struct timespec ts = mp_rel_time_to_timespec(timeout);
+ pthread_cond_timedwait(&p->wakeup, &p->lock, &ts);
} else {
pthread_cond_wait(&p->wakeup, &p->lock);
}
@@ -352,8 +353,10 @@ static void *playthread(void *arg)
if (ao->driver->get_delay)
timeout = ao->driver->get_delay(ao);
timeout *= 0.25; // wake up if 25% played
- if (!p->need_wakeup)
- mpthread_cond_timedwait_rel(&p->wakeup, &p->lock, timeout);
+ if (!p->need_wakeup) {
+ struct timespec ts = mp_rel_time_to_timespec(timeout);
+ pthread_cond_timedwait(&p->wakeup, &p->lock, &ts);
+ }
}
}
MP_STATS(ao, "end audio wait");