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

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


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

vout: process vout_NextPicture() 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=62f49fadfcf97ff9c7cf527755fc59e0f8d6775c
---

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

diff --git a/src/video_output/control.h b/src/video_output/control.h
index fcccc53d2a..80b1ec08ed 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -40,8 +40,6 @@ enum {
     VOUT_CONTROL_CHANGE_FILTERS,        /* string */
     VOUT_CONTROL_CHANGE_INTERLACE,      /* boolean */
 
-    VOUT_CONTROL_STEP,                  /* time_ptr */
-
     VOUT_CONTROL_MOUSE_STATE,           /* vlc_mouse_t */
     VOUT_CONTROL_DISPLAY_SIZE,          /* window */
     VOUT_CONTROL_DISPLAY_FILLED,        /* bool */
@@ -59,7 +57,6 @@ typedef struct {
 
     union {
         bool    boolean;
-        vlc_tick_t *time_ptr;
         char    *string;
         int     integer;
         struct {
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 413e8d8199..a7bb5dec29 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -478,16 +478,6 @@ bool vout_IsEmpty(vout_thread_t *vout)
     return !picture;
 }
 
-void vout_NextPicture(vout_thread_t *vout, vlc_tick_t *duration)
-{
-    vout_control_cmd_t cmd;
-    vout_control_cmd_Init(&cmd, VOUT_CONTROL_STEP);
-    cmd.time_ptr = duration;
-
-    vout_control_Push(&vout->p->control, &cmd);
-    vout_control_WaitEmpty(&vout->p->control);
-}
-
 void vout_DisplayTitle(vout_thread_t *vout, const char *title)
 {
     assert(title);
@@ -1533,15 +1523,18 @@ void vout_Flush(vout_thread_t *vout, vlc_tick_t date)
     vout_control_Release(&sys->control);
 }
 
-static void ThreadStep(vout_thread_t *vout, vlc_tick_t *duration)
+void vout_NextPicture(vout_thread_t *vout, vlc_tick_t *duration)
 {
     *duration = 0;
 
+    vout_control_Hold(&vout->p->control);
     if (vout->p->step.last == VLC_TICK_INVALID)
         vout->p->step.last = vout->p->displayed.timestamp;
 
-    if (ThreadDisplayPicture(vout, NULL))
+    if (ThreadDisplayPicture(vout, NULL)) {
+        vout_control_Release(&vout->p->control);
         return;
+    }
 
     vout->p->step.timestamp = vout->p->displayed.timestamp;
 
@@ -1551,6 +1544,7 @@ static void ThreadStep(vout_thread_t *vout, vlc_tick_t *duration)
         vout->p->step.last = vout->p->step.timestamp;
         /* TODO advance subpicture by the duration ... */
     }
+    vout_control_Release(&vout->p->control);
 }
 
 static void ThreadProcessMouseState(vout_thread_t *vout,
@@ -1798,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_STEP:
-        ThreadStep(vout, cmd.time_ptr);
-        break;
     case VOUT_CONTROL_MOUSE_STATE:
         ThreadProcessMouseState(vout, &cmd.mouse);
         break;



More information about the vlc-commits mailing list