[vlc-devel] [PATCH] vout: don't redisplay unchanged title on vout reuse

Francois Cartegnie fcvlcdev at free.fr
Thu Nov 8 17:55:46 CET 2018


---
 src/video_output/video_output.c  | 8 ++++++++
 src/video_output/vout_internal.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index cc95c4d874..8d64a20f4d 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -161,6 +161,7 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
     vout->p->title.show     = var_InheritBool(vout, "video-title-show");
     vout->p->title.timeout  = var_InheritInteger(vout, "video-title-timeout");
     vout->p->title.position = var_InheritInteger(vout, "video-title-position");
+    vout->p->title.previous = NULL;
 
     /* Get splitter name if present */
     vout->p->splitter_name = var_InheritString(vout, "video-splitter");
@@ -300,6 +301,7 @@ static void VoutDestructor(vlc_object_t *object)
     //assert(!vout->p_module);
 
     free(vout->p->splitter_name);
+    free(vout->p->title.previous);
 
     /* Destroy the locks */
     vlc_mutex_destroy(&vout->p->window_lock);
@@ -372,6 +374,12 @@ void vout_DisplayTitle(vout_thread_t *vout, const char *title)
     if (!vout->p->title.show)
         return;
 
+    if(vout->p->title.previous && !strcmp(vout->p->title.previous, title))
+        return;
+
+    free(vout->p->title.previous);
+    vout->p->title.previous = strdup(title);
+
     vout_OSDText(vout, VOUT_SPU_CHANNEL_OSD, vout->p->title.position,
                  VLC_TICK_FROM_MS(vout->p->title.timeout), title);
 }
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 8fb36a69db..589a5c7b63 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -117,6 +117,7 @@ struct vout_thread_sys_t
         bool        show;
         int         timeout;
         int         position;
+        char       *previous;
     } title;
 
     struct {
-- 
2.17.2



More information about the vlc-devel mailing list