[vlc-commits] vout/osd: do not queue an event to queue an event

Rémi Denis-Courmont git at videolan.org
Mon Aug 13 18:21:15 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 13 15:54:12 2018 +0300| [f14ce6d5aba7e58142290f4c0492c7fe7f972082] | committer: Rémi Denis-Courmont

vout/osd: do not queue an event to queue an event

Generate the OSD title subpicture directly, and only then queue the
resulting SPU to the video output as an event.

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

 src/video_output/control.c      |  1 -
 src/video_output/control.h      |  1 -
 src/video_output/video_output.c | 20 ++++++--------------
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/src/video_output/control.c b/src/video_output/control.c
index 8b3da801e4..1b9b1eaee4 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -43,7 +43,6 @@ void vout_control_cmd_Clean(vout_control_cmd_t *cmd)
         if (cmd->subpicture)
             subpicture_Delete(cmd->subpicture);
         break;
-    case VOUT_CONTROL_OSD_TITLE:
     case VOUT_CONTROL_CHANGE_FILTERS:
         free(cmd->string);
         break;
diff --git a/src/video_output/control.h b/src/video_output/control.h
index 6f0e9c5382..85155baddb 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -40,7 +40,6 @@ enum {
 #endif
     VOUT_CONTROL_SUBPICTURE,            /* subpicture */
     VOUT_CONTROL_FLUSH_SUBPICTURE,      /* integer */
-    VOUT_CONTROL_OSD_TITLE,             /* string */
     VOUT_CONTROL_CHANGE_FILTERS,        /* string */
     VOUT_CONTROL_CHANGE_INTERLACE,      /* boolean */
 
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 6e25d292a2..122f82eeb3 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -370,7 +370,12 @@ void vout_NextPicture(vout_thread_t *vout, vlc_tick_t *duration)
 void vout_DisplayTitle(vout_thread_t *vout, const char *title)
 {
     assert(title);
-    vout_control_PushString(&vout->p->control, VOUT_CONTROL_OSD_TITLE, title);
+
+    if (!vout->p->title.show)
+        return;
+
+    vout_OSDText(vout, VOUT_SPU_CHANNEL_OSD, vout->p->title.position,
+                 VLC_TICK_FROM_MS(vout->p->title.timeout), title);
 }
 
 void vout_MouseState(vout_thread_t *vout, const vlc_mouse_t *mouse)
@@ -1308,16 +1313,6 @@ static void ThreadFlushSubpicture(vout_thread_t *vout, int channel)
     spu_ClearChannel(vout->p->spu, channel);
 }
 
-static void ThreadDisplayOsdTitle(vout_thread_t *vout, const char *string)
-{
-    if (!vout->p->title.show)
-        return;
-
-    vout_OSDText(vout, VOUT_SPU_CHANNEL_OSD,
-                 vout->p->title.position, VLC_TICK_FROM_MS(vout->p->title.timeout),
-                 string);
-}
-
 static void ThreadChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
 {
     assert(!vout->p->pause.is_on || !is_paused);
@@ -1691,9 +1686,6 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
     case VOUT_CONTROL_FLUSH_SUBPICTURE:
         ThreadFlushSubpicture(vout, cmd.integer);
         break;
-    case VOUT_CONTROL_OSD_TITLE:
-        ThreadDisplayOsdTitle(vout, cmd.string);
-        break;
     case VOUT_CONTROL_CHANGE_FILTERS:
         ThreadChangeFilters(vout, NULL,
                             cmd.string != NULL ?



More information about the vlc-commits mailing list