[MPlayer-dev-eng] [PATCH] add -name and -title options for x video_outs
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Thu Oct 22 08:37:20 CEST 2009
> Index: libvo/x11_common.c
> ===================================================================
> --- libvo/x11_common.c (revisione 29789)
> +++ libvo/x11_common.c (copia locale)
> @@ -99,6 +99,8 @@
> Window mRootWin;
> int mScreen;
> int mLocalDisplay;
> +char *vo_winname;
> +char *vo_wintitle;
If it's called vo_winname and thus for all vos it should be in video_out.c,
not somewhere x11-specific.
> - wmClass.res_name = name;
> + if (vo_winname != NULL)
> + wmClass.res_name = vo_winname;
> + else
> + wmClass.res_name = name;
Use ?:
> +/**
> + * \brief set the X window title
> + * \param title title for the window
> + *
> + */
> +void vo_x11_settitle(char *title)
> +{
> + if(title != NULL)
> + vo_wintitle = title;
> +}
[...]
> + vo_x11_settitle(vo_wintitle);
That really makes no sense whatsoever.
Also the doxy is nonsense, vo_x11_settitle only
sets vo_wintitle, it does not set the title
of an existing window.
> Index: libvo/video_out.c
> ===================================================================
> --- libvo/video_out.c (revisione 29789)
> +++ libvo/video_out.c (copia locale)
> @@ -29,6 +29,9 @@
> #include "video_out.h"
> #include "aspect.h"
> #include "geometry.h"
> +#ifdef CONFIG_X11
> +#include "x11_common.h"
> +#endif
>
> #include "mp_msg.h"
> #include "help_mp.h"
> @@ -349,6 +352,11 @@
> vo_dheight = d_height;
> }
>
> +#ifdef CONFIG_X11
> + if (vo_wintitle != NULL)
> + title = vo_wintitle;
> +#endif
I don't see the point of making this X11-specific.
> Index: mplayer.c
> ===================================================================
> --- mplayer.c (revisione 29789)
> +++ mplayer.c (copia locale)
> @@ -2191,6 +2191,11 @@
> {
> char* vf_arg[] = { "_oldargs_", (char*)mpctx->video_out , NULL };
> sh_video->vfilter=(void*)vf_open_filter(NULL,"vo",vf_arg);
> +#ifdef CONFIG_X11
> + if(vo_wintitle == NULL)
> + vo_wintitle = mp_basename2 (filename);
> + vo_x11_settitle(vo_wintitle);
> +#endif
Seems to me like there's no way to get the current behaviour.
> Index: cfg-mplayer.h
> ===================================================================
> --- cfg-mplayer.h (revisione 29789)
> +++ cfg-mplayer.h (copia locale)
> @@ -170,6 +170,9 @@
> {"screenh", &vo_screenheight, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL},
> // Geometry string
> {"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
> + // X11 Hints strings
> + {"name", &vo_winname, CONF_TYPE_STRING, 0, 0, 0, NULL},
> + {"title", &vo_wintitle, CONF_TYPE_STRING, 0, 0, 0, NULL},
I have some doubts this really works correctly with -fixed-vo and different
values for these for different files.
More information about the MPlayer-dev-eng
mailing list