[FFmpeg-cvslog] sdl: use the filename for defining the window title, if not specified

Stefano Sabatini git at videolan.org
Sun Jun 5 13:46:52 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Sun Jun  5 00:57:05 2011 +0200| [0d0fdb0ad59c0533fb91dad00379f762573ce541] | committer: Stefano Sabatini

sdl: use the filename for defining the window title, if not specified

This allows a more efficient use of the commandline.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0d0fdb0ad59c0533fb91dad00379f762573ce541
---

 doc/outdevs.texi       |    9 +++------
 libavdevice/avdevice.h |    2 +-
 libavdevice/sdl.c      |    4 +++-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/doc/outdevs.texi b/doc/outdevs.texi
index 9985900..79619f8 100644
--- a/doc/outdevs.texi
+++ b/doc/outdevs.texi
@@ -45,8 +45,8 @@ For more information about SDL, check:
 @table @option
 
 @item window_title
-Set the SDL window title, if not specified default to "SDL video
-outdev".
+Set the SDL window title, if not specified default to the filename
+specified for the output device.
 
 @item icon_title
 Set the name of the iconified SDL window, if not specified it is set
@@ -63,12 +63,9 @@ If not specified it defaults to the size of the input video.
 The following command shows the @file{ffmpeg} output is an
 SDL window, forcing its size to the qcif format:
 @example
-ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl none
+ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
 @end example
 
-Note that the name specified for the output device is ignored, so it
-can be set to an arbitrary value ("none" in the above example).
-
 @section sndio
 
 sndio audio output device.
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index be56be4..e49e5b7 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -24,7 +24,7 @@
 
 #define LIBAVDEVICE_VERSION_MAJOR 53
 #define LIBAVDEVICE_VERSION_MINOR  1
-#define LIBAVDEVICE_VERSION_MICRO  0
+#define LIBAVDEVICE_VERSION_MICRO  1
 
 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
                                                LIBAVDEVICE_VERSION_MINOR, \
diff --git a/libavdevice/sdl.c b/libavdevice/sdl.c
index 07f60cd..36f65f2 100644
--- a/libavdevice/sdl.c
+++ b/libavdevice/sdl.c
@@ -78,6 +78,8 @@ static int sdl_write_header(AVFormatContext *s)
     float sar, dar; /* sample and display aspect ratios */
     int i, ret;
 
+    if (!sdl->window_title)
+        sdl->window_title = av_strdup(s->filename);
     if (!sdl->icon_title)
         sdl->icon_title = av_strdup(sdl->window_title);
 
@@ -201,7 +203,7 @@ static int sdl_write_packet(AVFormatContext *s, AVPacket *pkt)
 #define OFFSET(x) offsetof(SDLContext,x)
 
 static const AVOption options[] = {
-    { "window_title", "SDL window title",           OFFSET(window_title),  FF_OPT_TYPE_STRING, {.str = "SDL video outdev" }, 0,  0, AV_OPT_FLAG_ENCODING_PARAM },
+    { "window_title", "SDL window title",           OFFSET(window_title),  FF_OPT_TYPE_STRING, {.str = NULL }, 0,  0, AV_OPT_FLAG_ENCODING_PARAM },
     { "icon_title",   "SDL iconified window title", OFFSET(icon_title)  ,  FF_OPT_TYPE_STRING, {.str = NULL },               0,  0, AV_OPT_FLAG_ENCODING_PARAM },
     { "window_size",  "SDL window forced size",     OFFSET(window_size) ,  FF_OPT_TYPE_STRING, {.str = NULL },               0,  0, AV_OPT_FLAG_ENCODING_PARAM },
     { NULL },



More information about the ffmpeg-cvslog mailing list