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

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


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

vout: process vout_Flush() 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=6b7f7d8269fdab70ea37c04860342d92fbc06c84
---

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

diff --git a/src/video_output/control.h b/src/video_output/control.h
index 5055d129e3..9c7f5384e1 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_FLUSH,                 /* time */
     VOUT_CONTROL_STEP,                  /* time_ptr */
 
     VOUT_CONTROL_MOUSE_STATE,           /* vlc_mouse_t */
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index ddb983d052..413e8d8199 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -469,12 +469,6 @@ void vout_GetResetStatistic(vout_thread_t *vout, unsigned *restrict displayed,
     vout_statistic_GetReset( &vout->p->statistic, displayed, lost );
 }
 
-void vout_Flush(vout_thread_t *vout, vlc_tick_t date)
-{
-    vout_control_PushTime(&vout->p->control, VOUT_CONTROL_FLUSH, date);
-    vout_control_WaitEmpty(&vout->p->control);
-}
-
 bool vout_IsEmpty(vout_thread_t *vout)
 {
     picture_t *picture = picture_fifo_Peek(vout->p->decoder_fifo);
@@ -1505,7 +1499,8 @@ void vout_ChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
     vlc_mutex_unlock(&vout->p->window_lock);
 }
 
-static void ThreadFlush(vout_thread_t *vout, bool below, vlc_tick_t date)
+static void vout_FlushUnlocked(vout_thread_t *vout, bool below,
+                               vlc_tick_t date)
 {
     vout->p->step.timestamp = VLC_TICK_INVALID;
     vout->p->step.last      = VLC_TICK_INVALID;
@@ -1529,6 +1524,15 @@ static void ThreadFlush(vout_thread_t *vout, bool below, vlc_tick_t date)
     vout_FilterFlush(vout->p->display);
 }
 
+void vout_Flush(vout_thread_t *vout, vlc_tick_t date)
+{
+    vout_thread_sys_t *sys = vout->p;
+
+    vout_control_Hold(&sys->control);
+    vout_FlushUnlocked(vout, false, date);
+    vout_control_Release(&sys->control);
+}
+
 static void ThreadStep(vout_thread_t *vout, vlc_tick_t *duration)
 {
     *duration = 0;
@@ -1716,7 +1720,7 @@ static void ThreadStop(vout_thread_t *vout)
     /* Destroy translation tables */
     if (vout->p->display) {
         if (vout->p->decoder_pool)
-            ThreadFlush(vout, true, INT64_MAX);
+            vout_FlushUnlocked(vout, true, INT64_MAX);
         vout_CloseWrapper(vout);
     }
 
@@ -1794,9 +1798,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_FLUSH:
-        ThreadFlush(vout, false, cmd.time);
-        break;
     case VOUT_CONTROL_STEP:
         ThreadStep(vout, cmd.time_ptr);
         break;



More information about the vlc-commits mailing list