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

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


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

vout: process vout_ChangePause() 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=1d14e1696bf9e5adba3c3c35ce9e778bda819cea
---

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

diff --git a/src/video_output/control.h b/src/video_output/control.h
index 2ce7924e40..5055d129e3 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -40,7 +40,6 @@ enum {
     VOUT_CONTROL_CHANGE_FILTERS,        /* string */
     VOUT_CONTROL_CHANGE_INTERLACE,      /* boolean */
 
-    VOUT_CONTROL_PAUSE,
     VOUT_CONTROL_FLUSH,                 /* time */
     VOUT_CONTROL_STEP,                  /* time_ptr */
 
@@ -70,10 +69,6 @@ typedef struct {
             int b;
         } pair;
         struct {
-            bool is_on;
-            vlc_tick_t date;
-        } pause;
-        struct {
             unsigned left;
             unsigned top;
             unsigned right;
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index fd5ec5133e..408cbd3199 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -463,17 +463,6 @@ static void VoutDestructor(vlc_object_t *object)
 }
 
 /* */
-void vout_ChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
-{
-    vout_control_cmd_t cmd;
-    vout_control_cmd_Init(&cmd, VOUT_CONTROL_PAUSE);
-    cmd.pause.is_on = is_paused;
-    cmd.pause.date  = date;
-    vout_control_Push(&vout->p->control, &cmd);
-
-    vout_control_WaitEmpty(&vout->p->control);
-}
-
 void vout_GetResetStatistic(vout_thread_t *vout, unsigned *restrict displayed,
                             unsigned *restrict lost)
 {
@@ -1485,8 +1474,9 @@ static void ThreadFlushSubpicture(vout_thread_t *vout, int channel)
     spu_ClearChannel(vout->p->spu, channel);
 }
 
-static void ThreadChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
+void vout_ChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
 {
+    vout_control_Hold(&vout->p->control);
     assert(!vout->p->pause.is_on || !is_paused);
 
     if (vout->p->pause.is_on) {
@@ -1510,6 +1500,7 @@ static void ThreadChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t da
     vout->p->pause.date  = date;
 
     vout_window_SetInhibition(vout->p->display_cfg.window, !is_paused);
+    vout_control_Release(&vout->p->control);
 }
 
 static void ThreadFlush(vout_thread_t *vout, bool below, vlc_tick_t date)
@@ -1801,9 +1792,6 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
         ThreadChangeFilters(vout, NULL, vout->p->filter.configuration,
                             cmd.boolean ? 1 : 0, false);
         break;
-    case VOUT_CONTROL_PAUSE:
-        ThreadChangePause(vout, cmd.pause.is_on, cmd.pause.date);
-        break;
     case VOUT_CONTROL_FLUSH:
         ThreadFlush(vout, false, cmd.time);
         break;



More information about the vlc-commits mailing list