[FFmpeg-devel] [PATCH] vf_drawtext: drop text wrapping feature

Stefano Sabatini stefasab at gmail.com
Tue Sep 20 20:30:39 CEST 2011


Or in other word, do not go to the next line when the text cannot be
rendered within the frame.

The rationale is that wrapping is hard to manage, as it depends on the
position of the text, thus making hard/impossible to compute the size
occupied by the rendered text, and makes the filter behavior
unpredictible with moving text (implemented in a pending patch).
---
 libavfilter/vf_drawtext.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index fbb1e53..d7447c2 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -655,12 +655,6 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
             x += delta.x >> 6;
         }
 
-        if (x + glyph->bbox.xMax >= width) {
-            max_text_line_w = FFMAX(max_text_line_w, x - dtext->x);
-            y += max_text_line_h;
-            x = dtext->x;
-        }
-
         /* save position */
         dtext->positions[i].x = x + glyph->bitmap_left;
         dtext->positions[i].y = y - glyph->bitmap_top + baseline;
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list