From a0941c8a2b3e55dc4482c874523afcb7ed6e93e6 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Tue, 29 Jul 2014 21:10:39 +0200 Subject: Use new av_dict_set_int helper function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get rid of the many, slightly differing, implementations of basically the same thing. Signed-off-by: Reimar Döffinger --- libavfilter/vf_bbox.c | 4 +--- libavfilter/vf_cropdetect.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'libavfilter') diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c index 6c6aab140e..1e6feff508 100644 --- a/libavfilter/vf_bbox.c +++ b/libavfilter/vf_bbox.c @@ -61,8 +61,7 @@ static int query_formats(AVFilterContext *ctx) } #define SET_META(key, value) \ - snprintf(buf, sizeof(buf), "%d", value); \ - av_dict_set(metadata, key, buf, 0); + av_dict_set_int(metadata, key, value, 0); static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { @@ -70,7 +69,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) BBoxContext *bbox = ctx->priv; FFBoundingBox box; int has_bbox, w, h; - char buf[32]; has_bbox = ff_calculate_bounding_box(&box, diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index ed8e7a8c11..f85a0bbf93 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -113,8 +113,7 @@ static int config_input(AVFilterLink *inlink) } #define SET_META(key, value) \ - snprintf(buf, sizeof(buf), "%d", value); \ - av_dict_set(metadata, key, buf, 0) + av_dict_set_int(metadata, key, value, 0) static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { @@ -123,7 +122,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) int bpp = s->max_pixsteps[0]; int w, h, x, y, shrink_by; AVDictionary **metadata; - char buf[32]; // ignore first 2 frames - they may be empty if (++s->frame_nb > 0) { -- cgit v1.2.3