[vlc-commits] vout: process vout_Cancel() directly

Rémi Denis-Courmont git at videolan.org
Sun Jan 27 22:10:02 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 27 16:26:02 2019 +0200| [990e22a10dab1bee4890a43895c69e1d1b5be59b] | committer: Rémi Denis-Courmont

vout: process vout_Cancel() directly

Since the caller waits for completion, there are no benefits to
offloading the work to the video output thread.

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

 src/video_output/control.h      |  1 -
 src/video_output/video_output.c | 18 +++++++-----------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/video_output/control.h b/src/video_output/control.h
index ffeaf076f7..94dd4f21a1 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -29,7 +29,6 @@
 enum {
     VOUT_CONTROL_CLEAN,
     VOUT_CONTROL_REINIT,                /* cfg */
-    VOUT_CONTROL_CANCEL,
 
 #if 0
     /* */
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 98babd45fd..0800d772a0 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -460,12 +460,6 @@ static void VoutDestructor(vlc_object_t *object)
 }
 
 /* */
-void vout_Cancel(vout_thread_t *vout, bool canceled)
-{
-    vout_control_PushBool(&vout->p->control, VOUT_CONTROL_CANCEL, canceled);
-    vout_control_WaitEmpty(&vout->p->control);
-}
-
 void vout_ChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
 {
     vout_control_cmd_t cmd;
@@ -1767,9 +1761,14 @@ static int ThreadReinit(vout_thread_t *vout,
     return VLC_SUCCESS;
 }
 
-static void ThreadCancel(vout_thread_t *vout, bool canceled)
+void vout_Cancel(vout_thread_t *vout, bool canceled)
 {
-    picture_pool_Cancel(vout->p->decoder_pool, canceled);
+    vout_thread_sys_t *sys = vout->p;
+
+    vout_control_Hold(&sys->control);
+    if (sys->decoder_pool != NULL)
+        picture_pool_Cancel(sys->decoder_pool, canceled);
+    vout_control_Release(&sys->control);
 }
 
 static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
@@ -1782,9 +1781,6 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
         if (ThreadReinit(vout, cmd.cfg))
             return 1;
         break;
-    case VOUT_CONTROL_CANCEL:
-        ThreadCancel(vout, cmd.boolean);
-        break;
     case VOUT_CONTROL_SUBPICTURE:
         ThreadDisplaySubpicture(vout, cmd.subpicture);
         cmd.subpicture = NULL;



More information about the vlc-commits mailing list