Commit 453264d4 authored by flx42's avatar flx42 Committed by Jean-Baptiste Kempf
Browse files

vout: refactor deadline computation for cond_timedwait in vout_control_Pop

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <>
parent 07be06c0
......@@ -185,14 +185,11 @@ int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
const mtime_t max_deadline = mdate() + timeout;
const mtime_t wait_deadline = deadline <= VLC_TS_INVALID ? max_deadline : __MIN(deadline, max_deadline);
/* Spurious wakeups are perfectly fine */
if (ctrl->can_sleep) {
if (deadline <= VLC_TS_INVALID)
vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, max_deadline);
vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, __MIN(deadline, max_deadline));
if (ctrl->can_sleep)
vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, wait_deadline);
bool has_cmd;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment