Commit 372b9643 authored by stefano's avatar stefano

Add a -window_title option, which sets the FFplay window title.

Patch by Robert Krüger "krueger ET signal7 DOT de".

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22588 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 036e8e13
...@@ -51,6 +51,8 @@ Seek by bytes. ...@@ -51,6 +51,8 @@ Seek by bytes.
Disable graphical display. Disable graphical display.
@item -f @var{fmt} @item -f @var{fmt}
Force format. Force format.
@item -window_title @var{title}
Set window title (default is the input filename).
@end table @end table
@section Advanced options @section Advanced options
......
...@@ -224,6 +224,7 @@ static int audio_write_get_buf_size(VideoState *is); ...@@ -224,6 +224,7 @@ static int audio_write_get_buf_size(VideoState *is);
/* options specified by the user */ /* options specified by the user */
static AVInputFormat *file_iformat; static AVInputFormat *file_iformat;
static const char *input_filename; static const char *input_filename;
static const char *window_title;
static int fs_screen_width; static int fs_screen_width;
static int fs_screen_height; static int fs_screen_height;
static int screen_width = 0; static int screen_width = 0;
...@@ -993,7 +994,9 @@ static int video_open(VideoState *is){ ...@@ -993,7 +994,9 @@ static int video_open(VideoState *is){
fprintf(stderr, "SDL: could not set video mode - exiting\n"); fprintf(stderr, "SDL: could not set video mode - exiting\n");
return -1; return -1;
} }
SDL_WM_SetCaption("FFplay", "FFplay"); if (!window_title)
window_title = input_filename;
SDL_WM_SetCaption(window_title, window_title);
is->width = screen->w; is->width = screen->w;
is->height = screen->h; is->height = screen->h;
...@@ -2960,6 +2963,7 @@ static const OptionDef options[] = { ...@@ -2960,6 +2963,7 @@ static const OptionDef options[] = {
{ "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" }, { "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
{ "autoexit", OPT_BOOL | OPT_EXPERT, {(void*)&autoexit}, "exit at the end", "" }, { "autoexit", OPT_BOOL | OPT_EXPERT, {(void*)&autoexit}, "exit at the end", "" },
{ "framedrop", OPT_BOOL | OPT_EXPERT, {(void*)&framedrop}, "drop frames when cpu is too slow", "" }, { "framedrop", OPT_BOOL | OPT_EXPERT, {(void*)&framedrop}, "drop frames when cpu is too slow", "" },
{ "window_title", OPT_STRING | HAS_ARG, {(void*)&window_title}, "set window title", "window title" },
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
{ "vfilters", OPT_STRING | HAS_ARG, {(void*)&vfilters}, "video filters", "filter list" }, { "vfilters", OPT_STRING | HAS_ARG, {(void*)&vfilters}, "video filters", "filter list" },
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment