aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Krüger <krueger@signal7.de>2010-03-17 23:39:18 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-03-17 23:39:18 +0000
commit076db5ed57a0e260c6ee1eb76b88d056570e6e47 (patch)
treeaa60b319a1ae12d4359e079b0c0d2f4c7b191a61
parent1400bd5a3921012911b80e5e209fb8a2591347e6 (diff)
downloadffmpeg-076db5ed57a0e260c6ee1eb76b88d056570e6e47.tar.gz
Add a -window_title option, which sets the FFplay window title.
Patch by Robert Krüger "krueger ET signal7 DOT de". Originally committed as revision 22588 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--doc/ffplay-doc.texi2
-rw-r--r--ffplay.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/ffplay-doc.texi b/doc/ffplay-doc.texi
index f2f0d530db..e3d4bf6878 100644
--- a/doc/ffplay-doc.texi
+++ b/doc/ffplay-doc.texi
@@ -51,6 +51,8 @@ Seek by bytes.
Disable graphical display.
@item -f @var{fmt}
Force format.
+@item -window_title @var{title}
+Set window title (default is the input filename).
@end table
@section Advanced options
diff --git a/ffplay.c b/ffplay.c
index f80a71e07e..18edfa3ae8 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -224,6 +224,7 @@ static int audio_write_get_buf_size(VideoState *is);
/* options specified by the user */
static AVInputFormat *file_iformat;
static const char *input_filename;
+static const char *window_title;
static int fs_screen_width;
static int fs_screen_height;
static int screen_width = 0;
@@ -993,7 +994,9 @@ static int video_open(VideoState *is){
fprintf(stderr, "SDL: could not set video mode - exiting\n");
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->height = screen->h;
@@ -2960,6 +2963,7 @@ static const OptionDef options[] = {
{ "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", "" },
{ "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
{ "vfilters", OPT_STRING | HAS_ARG, {(void*)&vfilters}, "video filters", "filter list" },
#endif