[vlc-commits] display: remove title from configuration

Rémi Denis-Courmont git at videolan.org
Sun May 20 19:51:57 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri May 18 23:16:34 2018 +0300| [153e954abf633c80f9a4e17537dba93c932790e1] | committer: Rémi Denis-Courmont

display: remove title from configuration

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

 include/vlc_vout_display.h       |  3 ---
 modules/video_output/caca.c      | 10 ++++------
 modules/video_output/kva.c       | 20 +++++++++-----------
 src/video_output/video_output.c  |  5 ++---
 src/video_output/vout_internal.h |  1 -
 src/video_output/vout_wrapper.c  |  8 +-------
 6 files changed, 16 insertions(+), 31 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index d9fb6dbac2..33b8d438e6 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -73,9 +73,6 @@ typedef struct {
 
     /* Display properties */
     struct {
-        /* Window title (may be NULL) */
-        const char *title;
-
         /* Display size */
         unsigned  width;
         unsigned  height;
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index ce424ad9a6..cc733f83fd 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -461,12 +461,10 @@ static int Open(vlc_object_t *object)
         goto error;
     }
 
-    if (vd->cfg->display.title)
-        caca_set_display_title(sys->dp,
-                               vd->cfg->display.title);
-    else
-        caca_set_display_title(sys->dp,
-                               VOUT_TITLE "(Colour AsCii Art)");
+    char *title = var_InheritString(vd, "video-title");
+    caca_set_display_title(sys->dp,
+        (title != NULL) ? title : VOUT_TITLE "(Colour AsCii Art)");
+    free(title);
 
     block_fifo_t *fifo = block_FifoNew();
     if (likely(fifo != NULL)) {
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 2dc8c4ba04..fda02785cb 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -500,7 +500,6 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
     bool b_hw_accel = 0;
     FOURCC i_kva_fourcc;
     int i_chroma_shift;
-    char sz_title[ 256 ];
     RECTL rcl;
     int w, h;
 
@@ -633,16 +632,15 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
         return VLC_ENOMEM;
     }
 
-    if (vd->cfg->display.title)
-        snprintf( sz_title, sizeof( sz_title ), "%s", vd->cfg->display.title );
-    else
-        snprintf( sz_title, sizeof( sz_title ),
-                  "%s (%4.4s to %4.4s - %s mode KVA output)",
-                  VOUT_TITLE,
-                  ( char * )&vd->fmt.i_chroma,
-                  ( char * )&sys->kvas.fccSrcColor,
-                  psz_video_mode[ sys->kvac.ulMode - 1 ]);
-    WinSetWindowText( sys->frame, sz_title );
+    char *title = var_InheritString( vd, "video-title" );
+    if (title != NULL
+     || asprintf( &title, VOUT_TITLE " (%4.4s to %4.4s - %s mode KVA output)",
+                  (char *)&vd->fmt.i_chroma, (char *)&sys->kvas.fccSrcColor,
+                  psz_video_mode[sys->kvac.ulMode - 1] ) >= 0)
+    {
+        WinSetWindowText( sys->frame, title );
+        free( title );
+    }
 
     sys->cursor_timeout = var_InheritInteger( vd, "mouse-hide-timeout" )
                           * (CLOCK_FREQ / 1000);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 58b276492b..96f8028f1b 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -577,7 +577,7 @@ void vout_ControlChangeViewpoint(vout_thread_t *vout,
 }
 
 /* */
-static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, const char *title)
+static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg)
 {
     /* Load configuration */
     cfg->window = vout->p->window;
@@ -587,7 +587,6 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
 #endif
     cfg->viewpoint = vout->p->original.pose;
 
-    cfg->display.title = title;
     const int display_width = var_GetInteger(vout, "width");
     const int display_height = var_GetInteger(vout, "height");
     cfg->display.width   = display_width > 0  ? display_width  : 0;
@@ -1492,7 +1491,7 @@ static int ThreadStart(vout_thread_t *vout, vout_display_state_t *state)
 
     vout_display_state_t state_default;
     if (!state) {
-        VoutGetDisplayCfg(vout, &state_default.cfg, vout->p->display.title);
+        VoutGetDisplayCfg(vout, &state_default.cfg);
 
 #if defined(_WIN32) || defined(__OS2__)
         bool below = var_InheritBool(vout, "video-wallpaper");
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 9a6083ca7d..d74e7cc462 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -88,7 +88,6 @@ struct vout_thread_sys_t
 
     /* */
     struct {
-        char           *title;
         vout_display_t *vd;
         bool           use_dr;
     } display;
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 41c60c4a1a..6d13f92d59 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -54,9 +54,6 @@ int vout_OpenWrapper(vout_thread_t *vout,
     msg_Dbg(vout, "Opening vout display wrapper");
 
     /* */
-    sys->display.title = var_InheritString(vout, "video-title");
-
-    /* */
     char *modlist = var_InheritString(vout, "vout");
 
     if (splitter_name)
@@ -65,10 +62,8 @@ int vout_OpenWrapper(vout_thread_t *vout,
         sys->display.vd = vout_NewDisplay(vout, &vout->p->original, state, modlist);
     free(modlist);
 
-    if (!sys->display.vd) {
-        free(sys->display.title);
+    if (!sys->display.vd)
         return VLC_EGENERIC;
-    }
 
     /* */
 #ifdef _WIN32
@@ -95,7 +90,6 @@ void vout_CloseWrapper(vout_thread_t *vout, vout_display_state_t *state)
     sys->decoder_pool = NULL; /* FIXME remove */
 
     vout_DeleteDisplay(sys->display.vd, state);
-    free(sys->display.title);
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list