[vlc-devel] [PATCH 6/7] vout/control: keep waiting until new commands / woken up / deadline

Steve Lhomme robux4 at ycbcr.xyz
Thu Aug 13 14:12:47 CEST 2020


---
 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 93bf7c3f92a..a4f92771eda 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -134,10 +134,10 @@ int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
 {
     vlc_mutex_lock(&ctrl->lock);
 
-    if (ctrl->cmd.i_size <= 0) {
-        /* Spurious wakeups are perfectly fine */
-        if (deadline != INVALID_DEADLINE && ctrl->can_sleep) {
-            vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, deadline);
+    if (deadline != INVALID_DEADLINE) {
+        while (ctrl->cmd.i_size <= 0 && ctrl->can_sleep) {
+            if (vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, deadline))
+                break;
         }
     }
 
-- 
2.26.2



More information about the vlc-devel mailing list