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

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


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

vout: process vout_Stop() 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=8dc5c43e7c035d462402f2f8a9ebb93394341cb4
---

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

diff --git a/src/video_output/control.h b/src/video_output/control.h
index 94dd4f21a1..2ce7924e40 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -44,7 +44,6 @@ enum {
     VOUT_CONTROL_FLUSH,                 /* time */
     VOUT_CONTROL_STEP,                  /* time_ptr */
 
-    VOUT_CONTROL_MOUSE_DISABLE,
     VOUT_CONTROL_MOUSE_STATE,           /* vlc_mouse_t */
     VOUT_CONTROL_DISPLAY_SIZE,          /* window */
     VOUT_CONTROL_DISPLAY_FILLED,        /* bool */
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0800d772a0..fd5ec5133e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -402,10 +402,13 @@ vout_thread_t *vout_Request(vlc_object_t *object,
 
 void vout_Stop(vout_thread_t *vout)
 {
-    spu_Detach(vout->p->spu);
+    vout_thread_sys_t *sys = vout->p;
 
-    vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_MOUSE_DISABLE);
-    vout_control_WaitEmpty(&vout->p->control);
+    spu_Detach(sys->spu);
+
+    vout_control_Hold(&sys->control);
+    sys->mouse_event = NULL;
+    vout_control_Release(&sys->control);
 }
 
 void vout_Close(vout_thread_t *vout)
@@ -1807,9 +1810,6 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
     case VOUT_CONTROL_STEP:
         ThreadStep(vout, cmd.time_ptr);
         break;
-    case VOUT_CONTROL_MOUSE_DISABLE:
-        vout->p->mouse_event = NULL;
-        break;
     case VOUT_CONTROL_MOUSE_STATE:
         ThreadProcessMouseState(vout, &cmd.mouse);
         break;



More information about the vlc-commits mailing list