[FFmpeg-cvslog] vf_drawtext: perform misc cosmetics changes to uninit
Stefano Sabatini
git at videolan.org
Sat Sep 24 12:42:10 CEST 2011
ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Sep 23 14:13:47 2011 +0200| [3de684206e940454a5276756620b794b0673d8b9] | committer: Stefano Sabatini
vf_drawtext: perform misc cosmetics changes to uninit
In particular:
* lexically sort strings freeing commands
* logically group freeing instructions
* prefer NULL over 0 when setting dtext->glyphs
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3de684206e940454a5276756620b794b0673d8b9
---
libavfilter/vf_drawtext.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 373dd70..888c996 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -403,20 +403,22 @@ static av_cold void uninit(AVFilterContext *ctx)
av_expr_free(dtext->x_pexpr); dtext->x_pexpr = NULL;
av_expr_free(dtext->y_pexpr); dtext->y_pexpr = NULL;
- av_freep(&dtext->fontfile);
- av_freep(&dtext->text);
+ av_freep(&dtext->boxcolor_string);
av_freep(&dtext->expanded_text);
av_freep(&dtext->fontcolor_string);
- av_freep(&dtext->boxcolor_string);
- av_freep(&dtext->positions);
+ av_freep(&dtext->fontfile);
+ av_freep(&dtext->shadowcolor_string);
+ av_freep(&dtext->text);
av_freep(&dtext->x_expr);
av_freep(&dtext->y_expr);
+ av_freep(&dtext->positions);
dtext->nb_positions = 0;
- av_freep(&dtext->shadowcolor_string);
+
av_tree_enumerate(dtext->glyphs, NULL, NULL, glyph_enu_free);
av_tree_destroy(dtext->glyphs);
- dtext->glyphs = 0;
+ dtext->glyphs = NULL;
+
FT_Done_Face(dtext->face);
FT_Done_FreeType(dtext->library);
@@ -424,7 +426,6 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&dtext->box_line[i]);
dtext->pixel_step[i] = 0;
}
-
}
static int config_input(AVFilterLink *inlink)
More information about the ffmpeg-cvslog
mailing list