[vlc-commits] vout: check the can_sleep flag when a deadline is provided

Felix Abecassis git at videolan.org
Thu Feb 20 13:12:11 CET 2014


vlc | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Wed Feb 19 12:30:04 2014 +0100| [07be06c0cdf0433711cdb33341c2b22c6067e15b] | committer: Jean-Baptiste Kempf

vout: check the can_sleep flag when a deadline is provided

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=07be06c0cdf0433711cdb33341c2b22c6067e15b
---

 src/video_output/control.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/video_output/control.c b/src/video_output/control.c
index bc7bda2..7b4a19b 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -187,11 +187,11 @@ int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
         const mtime_t max_deadline = mdate() + timeout;
 
         /* Spurious wakeups are perfectly fine */
-        if (deadline <= VLC_TS_INVALID) {
-            if (ctrl->can_sleep)
+        if (ctrl->can_sleep) {
+            if (deadline <= VLC_TS_INVALID)
                 vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, max_deadline);
-        } else {
-            vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, __MIN(deadline, max_deadline));
+            else
+                vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, __MIN(deadline, max_deadline));
         }
     }
 



More information about the vlc-commits mailing list