From 952f9b85a7f4d3140dde530585456cd0b42d258a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 4 Nov 2010 04:41:11 +0100 Subject: options: move -name and -title to option struct --- cfg-mplayer.h | 4 ++-- libvo/video_out.c | 4 ---- libvo/video_out.h | 3 --- libvo/x11_common.c | 8 +++++--- mplayer.c | 4 ++-- options.h | 2 ++ 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/cfg-mplayer.h b/cfg-mplayer.h index ba2a912ded..54282f3f4a 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -159,8 +159,8 @@ const m_option_t mplayer_opts[]={ OPT_FLAG_ON("force-window-position", force_window_position, 0), OPT_FLAG_OFF("noforce-window-position", force_window_position, 0), // vo name (X classname) and window title strings - {"name", &vo_winname, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"title", &vo_wintitle, CONF_TYPE_STRING, 0, 0, 0, NULL}, + OPT_STRING("name", vo_winname, 0), + OPT_STRING("title", vo_wintitle, 0), // set aspect ratio of monitor - useful for 16:9 TV-out OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0), OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0), diff --git a/libvo/video_out.c b/libvo/video_out.c index e223830e1e..57e0444094 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -70,10 +70,6 @@ int vo_directrendering=0; int vo_colorkey = 0x0000ff00; // default colorkey is green // (0xff000000 means that colorkey has been disabled) -// name to be used instead of the vo's default -char *vo_winname; -// title to be applied to movie window -char *vo_wintitle; // // Externally visible list of all vo drivers diff --git a/libvo/video_out.h b/libvo/video_out.h index e2ecfd512d..380e3b7f95 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -322,9 +322,6 @@ extern char *vo_subdevice; extern int vo_colorkey; -extern char *vo_winname; -extern char *vo_wintitle; - extern int64_t WinID; typedef struct { diff --git a/libvo/x11_common.c b/libvo/x11_common.c index ffe5e8120b..655b1c69d0 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -706,11 +706,12 @@ void vo_x11_decoration(struct vo *vo, int d) void vo_x11_classhint(struct vo *vo, Window window, const char *name) { + struct MPOpts *opts = vo->opts; struct vo_x11_state *x11 = vo->x11; XClassHint wmClass; pid_t pid = getpid(); - wmClass.res_name = vo_winname ? vo_winname : name; + wmClass.res_name = opts->vo_winname ? opts->vo_winname : name; wmClass.res_class = "MPlayer"; XSetClassHint(x11->display, window, &wmClass); XChangeProperty(x11->display, window, x11->XA_NET_WM_PID, XA_CARDINAL, @@ -1308,6 +1309,7 @@ static int vo_x11_get_fs_type(int supported) */ int vo_x11_update_geometry(struct vo *vo) { + struct MPOpts *opts = vo->opts; struct vo_x11_state *x11 = vo->x11; unsigned depth, w, h; int dummy_int; @@ -1320,8 +1322,8 @@ int vo_x11_update_geometry(struct vo *vo) } XTranslateCoordinates(x11->display, x11->window, x11->rootwin, 0, 0, &vo->dx, &vo->dy, &dummy_win); - if (vo_wintitle) - XStoreName(x11->display, x11->window, vo_wintitle); + if (opts->vo_wintitle) + XStoreName(x11->display, x11->window, opts->vo_wintitle); return depth <= INT_MAX ? depth : 0; } diff --git a/mplayer.c b/mplayer.c index ae4671114a..b44e272599 100644 --- a/mplayer.c +++ b/mplayer.c @@ -3541,8 +3541,8 @@ while (player_idle_mode && !mpctx->filename) { if (mpctx->filename) { mp_tmsg(MSGT_CPLAYER,MSGL_INFO,"\nPlaying %s.\n", filename_recode(mpctx->filename)); - if(use_filename_title && vo_wintitle == NULL) - vo_wintitle = strdup(mp_basename2(mpctx->filename)); + if(use_filename_title && opts->vo_wintitle == NULL) + opts->vo_wintitle = strdup(mp_basename2(mpctx->filename)); } if (edl_filename) { diff --git a/options.h b/options.h index 91ea2832d2..8450435bba 100644 --- a/options.h +++ b/options.h @@ -11,6 +11,8 @@ typedef struct MPOpts { int vo_screenwidth; int vo_screenheight; int force_window_position; + char *vo_winname; + char *vo_wintitle; float force_monitor_aspect; float monitor_pixel_aspect; int vidmode; -- cgit v1.2.3