[vlc-commits] video_output: remove the dead (don't push) control handling in video_output

Steve Lhomme git at videolan.org
Tue Jan 19 08:56:40 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Dec 17 10:19:03 2020 +0100| [d6deadd5897622588688854b2f60b0beb991ab15] | committer: Steve Lhomme

video_output: remove the dead (don't push) control handling in video_output

When vout_control_Dead() was called the vout thread was already dead. But
before that call happened, other threads may have been pushing commands in the
control FIFO. So this call only helped a bit.

In the end all previously enqueued commands will be ignored anyway. The control
FIFO will just be cleaned a few lines later in vout_Release().

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

 src/video_output/control.c      | 14 ++------------
 src/video_output/control.h      |  2 --
 src/video_output/video_output.c |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/video_output/control.c b/src/video_output/control.c
index fa5210bba9..b22d0a03f6 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -38,7 +38,6 @@ void vout_control_Init(vout_control_t *ctrl)
 
     ctrl->is_held = false;
     ctrl->is_waiting = false;
-    ctrl->is_dead = false;
     ctrl->can_sleep = true;
     ARRAY_INIT(ctrl->cmd);
 }
@@ -49,20 +48,11 @@ void vout_control_Clean(vout_control_t *ctrl)
     ARRAY_RESET(ctrl->cmd);
 }
 
-void vout_control_Dead(vout_control_t *ctrl)
-{
-    vlc_mutex_lock(&ctrl->lock);
-    ctrl->is_dead = true;
-    vlc_mutex_unlock(&ctrl->lock);
-}
-
 static void vout_control_Push(vout_control_t *ctrl, vout_control_cmd_t *cmd)
 {
     vlc_mutex_lock(&ctrl->lock);
-    if (!ctrl->is_dead) {
-        ARRAY_APPEND(ctrl->cmd, *cmd);
-        vlc_cond_signal(&ctrl->wait_request);
-    }
+    ARRAY_APPEND(ctrl->cmd, *cmd);
+    vlc_cond_signal(&ctrl->wait_request);
     vlc_mutex_unlock(&ctrl->lock);
 }
 
diff --git a/src/video_output/control.h b/src/video_output/control.h
index 5976a0f675..464bf349cc 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -43,7 +43,6 @@ typedef struct {
     vlc_cond_t  wait_available;
 
     /* */
-    bool is_dead;
     bool can_sleep;
     bool is_waiting;
     bool is_held;
@@ -63,6 +62,5 @@ void vout_control_Release(vout_control_t *);
 
 /* control inside of the vout thread */
 int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, vlc_tick_t deadline);
-void vout_control_Dead(vout_control_t *);
 
 #endif
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 29b8b140e0..b9ed2f4988 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -2010,7 +2010,6 @@ void vout_Close(vout_thread_t *vout)
 
     vout_IntfDeinit(VLC_OBJECT(vout));
     vout_snapshot_End(sys->snapshot);
-    vout_control_Dead(&sys->control);
     vout_chrono_Clean(&sys->render);
 
     if (sys->spu)



More information about the vlc-commits mailing list