[FFmpeg-cvslog] vf_drawtext: remove useless and misnamed intermediary "baseline" variable in draw_text()

Stefano Sabatini git at videolan.org
Thu Sep 22 00:48:59 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Wed Sep 21 23:47:44 2011 +0200| [3a87dce6bf1b5677c06239a034031ff69f718d5e] | committer: Stefano Sabatini

vf_drawtext: remove useless and misnamed intermediary "baseline" variable in draw_text()

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

 libavfilter/vf_drawtext.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index c52264b..2b34768 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -560,7 +560,7 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
     DrawTextContext *dtext = ctx->priv;
     uint32_t code = 0, prev_code = 0;
     int x = 0, y = 0, i = 0, ret;
-    int text_height, baseline;
+    int text_height;
     char *text = dtext->text;
     uint8_t *p;
     int str_w = 0, len;
@@ -624,7 +624,6 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
         y_max = FFMAX(glyph->bbox.yMax, y_max);
     }
     text_height = y_max - y_min;
-    baseline    = y_max;
 
     /* compute and save position for each glyph */
     glyph = NULL;
@@ -663,7 +662,7 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
 
         /* save position */
         dtext->positions[i].x = x + glyph->bitmap_left;
-        dtext->positions[i].y = y - glyph->bitmap_top + baseline;
+        dtext->positions[i].y = y - glyph->bitmap_top + y_max;
         if (code == '\t') x  = (x / dtext->tabsize + 1)*dtext->tabsize;
         else              x += glyph->advance;
     }



More information about the ffmpeg-cvslog mailing list