[vlc-commits] vout: remove the INIT control

Rémi Denis-Courmont git at videolan.org
Mon Aug 13 18:21:16 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 13 11:48:05 2018 +0300| [8fc710abc5368c7abdaaff7a797cab2586367f96] | committer: Rémi Denis-Courmont

vout: remove the INIT control

It was posted exactly once as the first control and never again. Instead,
this handles the event implicitly when the video output thread starts.

The control queue processing flag must now be initially set, so that the
first WaitEmpty() actually waits for the video output thread to
initialize and get ready to process events.

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

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

diff --git a/src/video_output/control.c b/src/video_output/control.c
index 1b9b1eaee4..b67ee7fec7 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -60,7 +60,7 @@ void vout_control_Init(vout_control_t *ctrl)
 
     ctrl->is_dead = false;
     ctrl->can_sleep = true;
-    ctrl->is_processing = false;
+    ctrl->is_processing = true;
     ARRAY_INIT(ctrl->cmd);
 }
 
diff --git a/src/video_output/control.h b/src/video_output/control.h
index 85155baddb..9be9f64b3e 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -28,7 +28,6 @@
 
 /* */
 enum {
-    VOUT_CONTROL_INIT,
     VOUT_CONTROL_CLEAN,
     VOUT_CONTROL_REINIT,                /* cfg */
     VOUT_CONTROL_CANCEL,
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 122f82eeb3..da8022a8f3 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -143,8 +143,6 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
     vout->p->pause.date = VLC_TICK_INVALID;
 
     vout_control_Init(&vout->p->control);
-    vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_INIT);
-
     vout_statistic_Init(&vout->p->statistic);
     vout_snapshot_Init(&vout->p->snapshot);
     vout_chrono_Init(&vout->p->render, 5, VLC_TICK_FROM_MS(10)); /* Arbitrary initial time */
@@ -1665,10 +1663,6 @@ static void ThreadCancel(vout_thread_t *vout, bool canceled)
 static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
 {
     switch(cmd.type) {
-    case VOUT_CONTROL_INIT:
-        if (ThreadStart(vout, NULL))
-            return 1;
-        break;
     case VOUT_CONTROL_CLEAN:
         ThreadStop(vout, NULL);
         return 1;
@@ -1755,6 +1749,10 @@ static void *Thread(void *object)
 
     vlc_tick_t deadline = VLC_TICK_INVALID;
     bool wait = false;
+
+    if (ThreadStart(vout, NULL))
+        goto out;
+
     for (;;) {
         vout_control_cmd_t cmd;
 



More information about the vlc-commits mailing list