Skip to content

Commit

Permalink
display: remove title from configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Denis-Courmont committed May 20, 2018
1 parent eaecbe6 commit 153e954
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 31 deletions.
3 changes: 0 additions & 3 deletions include/vlc_vout_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ typedef struct {

/* Display properties */
struct {
/* Window title (may be NULL) */
const char *title;

/* Display size */
unsigned width;
unsigned height;
Expand Down
10 changes: 4 additions & 6 deletions modules/video_output/caca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
20 changes: 9 additions & 11 deletions modules/video_output/kva.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions src/video_output/video_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
1 change: 0 additions & 1 deletion src/video_output/vout_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ struct vout_thread_sys_t

/* */
struct {
char *title;
vout_display_t *vd;
bool use_dr;
} display;
Expand Down
8 changes: 1 addition & 7 deletions src/video_output/vout_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ int vout_OpenWrapper(vout_thread_t *vout,
vout_thread_sys_t *sys = vout->p;
msg_Dbg(vout, "Opening vout display wrapper");

/* */
sys->display.title = var_InheritString(vout, "video-title");

/* */
char *modlist = var_InheritString(vout, "vout");

Expand All @@ -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
Expand All @@ -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);
}

/*****************************************************************************
Expand Down

0 comments on commit 153e954

Please sign in to comment.