[FFmpeg-devel] [PATCH] lavfi/vf_drawtext: default to expansion=normal.

Nicolas George nicolas.george at normalesup.org
Thu Jan 17 12:25:58 CET 2013


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 doc/filters.texi          |   12 ++++++------
 libavfilter/vf_drawtext.c |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)


The new syntax has been introduced two months ago, with a warning about the
deprecation of the old syntax. There was a stable release in between.


diff --git a/doc/filters.texi b/doc/filters.texi
index da7e816..61a59b4 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1937,8 +1937,8 @@ See below for the list of accepted constants and functions.
 
 @item expansion
 Select how the @var{text} is expanded. Can be either @code{none},
- at code{strftime} (default for compatibity reasons but deprecated) or
- at code{normal}. See the @ref{drawtext_expansion, Text expansion} section
+ at code{strftime} (deprecated) or
+ at code{normal} (default). See the @ref{drawtext_expansion, Text expansion} section
 below for details.
 
 @item fix_bounds
@@ -2112,14 +2112,14 @@ If libavfilter was built with @code{--enable-fontconfig}, then
 @anchor{drawtext_expansion}
 @subsection Text expansion
 
-If @option{expansion} is set to @code{strftime} (which is the default for
-now), the filter recognizes strftime() sequences in the provided text and
+If @option{expansion} is set to @code{strftime},
+the filter recognizes strftime() sequences in the provided text and
 expands them accordingly. Check the documentation of strftime(). This
 feature is deprecated.
 
 If @option{expansion} is set to @code{none}, the text is printed verbatim.
 
-If @option{expansion} is set to @code{normal} (which will be the default),
+If @option{expansion} is set to @code{normal} (which is the default),
 the following expansion mechanism is used.
 
 The backslash character '\', followed by any character, always expands to
@@ -2236,7 +2236,7 @@ drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
 @item
 Print the date of a real-time encoding (see strftime(3)):
 @example
-drawtext='fontfile=FreeSans.ttf:expansion=normal:text=%@{localtime:%a %b %d %Y@}'
+drawtext='fontfile=FreeSans.ttf:text=%@{localtime:%a %b %d %Y@}'
 @end example
 
 @end itemize
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 53a60b1..2358e35 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -188,7 +188,7 @@ static const AVOption drawtext_options[]= {
 {"basetime", "set base time",        OFFSET(basetime),           AV_OPT_TYPE_INT64,  {.i64=AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX , FLAGS},
 {"draw",     "if false do not draw", OFFSET(draw_expr),          AV_OPT_TYPE_STRING, {.str="1"},   CHAR_MIN, CHAR_MAX, FLAGS},
 
-{"expansion","set the expansion mode", OFFSET(exp_mode),         AV_OPT_TYPE_INT,    {.i64=EXP_STRFTIME}, 0,        2, FLAGS, "expansion"},
+{"expansion","set the expansion mode", OFFSET(exp_mode),         AV_OPT_TYPE_INT,    {.i64=EXP_NORMAL},   0,        2, FLAGS, "expansion"},
 {"none",     "set no expansion",     OFFSET(exp_mode),           AV_OPT_TYPE_CONST,  {.i64=EXP_NONE},     0,        0, FLAGS, "expansion"},
 {"normal",   "set normal expansion", OFFSET(exp_mode),           AV_OPT_TYPE_CONST,  {.i64=EXP_NORMAL},   0,        0, FLAGS, "expansion"},
 {"strftime", "set strftime expansion (deprecated)", OFFSET(exp_mode), AV_OPT_TYPE_CONST, {.i64=EXP_STRFTIME}, 0,    0, FLAGS, "expansion"},
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list