[vlc-devel] [PATCH 06/10] vout: control: do not wait until the deadline for incoming commands

Steve Lhomme robux4 at ycbcr.xyz
Fri Jul 17 13:50:49 CEST 2020


Either there are pending commands (filters and mouse handling) and we apply
them before processing the next picture. Or there is none and they will be
handled with the next frame.
---
 src/video_output/control.c      | 13 +------------
 src/video_output/control.h      |  2 +-
 src/video_output/video_output.c |  2 +-
 3 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/video_output/control.c b/src/video_output/control.c
index 459dea5b697..21b99efb326 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -140,21 +140,10 @@ void vout_control_Release(vout_control_t *ctrl)
     vlc_mutex_unlock(&ctrl->lock);
 }
 
-int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
-                     vlc_tick_t deadline)
+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 != VLC_TICK_INVALID && ctrl->can_sleep) {
-            ctrl->is_waiting = true;
-            vlc_cond_signal(&ctrl->wait_available);
-            vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, deadline);
-            ctrl->is_waiting = false;
-        }
-    }
-
     while (ctrl->is_held)
         vlc_cond_wait(&ctrl->wait_available, &ctrl->lock);
 
diff --git a/src/video_output/control.h b/src/video_output/control.h
index f91dd9f47b8..55503f826d7 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -74,6 +74,6 @@ void vout_control_Release(vout_control_t *);
 void vout_control_Dead(vout_control_t *);
 
 /* control inside of the vout thread */
-int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, vlc_tick_t deadline);
+int vout_control_Pop(vout_control_t *, vout_control_cmd_t *);
 
 #endif
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0e80d36daf1..6b12e492ffe 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1854,7 +1854,7 @@ static void *Thread(void *object)
             deadline = VLC_TICK_INVALID;
         }
 
-        while (!vout_control_Pop(&sys->control, &cmd, deadline)) {
+        while (!vout_control_Pop(&sys->control, &cmd)) {
             switch(cmd.type) {
                 case VOUT_CONTROL_TERMINATE:
                     return NULL; /* no need to clean &cmd */
-- 
2.26.2



More information about the vlc-devel mailing list