diff options
author | wm4 <wm4@nowhere> | 2012-08-02 02:36:26 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-02 02:37:00 +0200 |
commit | d5315a678ea93110f8bde10fe83eca64202988d1 (patch) | |
tree | 9f6212fb1192ef42658a98c31f746cbf28af054e /mplayer.c | |
parent | c7a15ed0ddf56b80a962a6aeb5da7981472ceaf2 (diff) | |
download | mpv-d5315a678ea93110f8bde10fe83eca64202988d1.tar.bz2 mpv-d5315a678ea93110f8bde10fe83eca64202988d1.tar.xz |
mplayer: expand --title as property, remove --use-filename-title
The --title option, which sets the GUI window caption, is now expanded
as slave mode property string (like osd_show_property_text). Make the
default value for --title include the filename. This makes a behavior
similar to --use-filename-title the default.
Remove the --use-filename-title option, as it's redundant now.
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -247,7 +247,6 @@ FILE *edl_fd; // file to write to when in -edlout mode. char *edl_output_filename; // file to put EDL entries in (-edlout) int use_filedir_conf; -int use_filename_title; #include "mpcommon.h" #include "command.h" @@ -2311,6 +2310,16 @@ static int fill_audio_out_buffers(struct MPContext *mpctx, double endpts) return -partial_fill; } +static void vo_update_window_title(struct MPContext *mpctx) +{ + if (!mpctx->video_out) + return; + char *title = property_expand_string(mpctx, mpctx->opts.vo_wintitle); + talloc_free(mpctx->video_out->window_title); + mpctx->video_out->window_title = talloc_strdup(mpctx->video_out, title); + free(title); +} + int reinit_video_chain(struct MPContext *mpctx) { struct MPOpts *opts = &mpctx->opts; @@ -2334,6 +2343,8 @@ int reinit_video_chain(struct MPContext *mpctx) mpctx->initialized_flags |= INITIALIZED_VO; } + vo_update_window_title(mpctx); + if (stream_control(mpctx->demuxer->stream, STREAM_CTRL_GET_ASPECT_RATIO, &ar) != STREAM_UNSUPPORTED) mpctx->sh_video->stream_aspect = ar; @@ -3750,8 +3761,6 @@ play_next_file: vo_control(mpctx->video_out, VOCTRL_RESUME, NULL); mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Playing %s.\n", mpctx->filename); - if (use_filename_title && opts->vo_wintitle == NULL) - opts->vo_wintitle = talloc_strdup(NULL, mp_basename(mpctx->filename)); if (edl_output_filename) { if (edl_fd) |