drawtext: fix text_{w, h} expression vars
authorAndrey Utkin <andrey.krieger.utkin@gmail.com>
Sat, 4 Feb 2012 22:14:16 +0000 (00:14 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 6 Feb 2012 06:52:05 +0000 (07:52 +0100)
Before, {text_,}{w,h} vars hadn't got initialized

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavfilter/vf_drawtext.c

index c5a6ffe..f6ce124 100644 (file)
@@ -550,7 +550,9 @@ static int dtext_prepare_text(AVFilterContext *ctx)
     y     = FFMIN(y + text_height, height - 1);
 
     dtext->w = str_w;
+    dtext->var_values[VAR_TEXT_W] = dtext->var_values[VAR_TW] = dtext->w;
     dtext->h = y;
+    dtext->var_values[VAR_TEXT_H] = dtext->var_values[VAR_TH] = dtext->h;
 
     return 0;
 }