summaryrefslogtreecommitdiff
path: root/libavfilter/vsrc_color.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-27 07:49:45 +0100
committerAnton Khirnov <anton@khirnov.net>2012-11-28 08:50:19 +0100
commit565e4993c63f797e2d50ad2f1e8f62fdbe299666 (patch)
treebae5282b2ee875de4b01467f3cfaab54b0ab6ec0 /libavfilter/vsrc_color.c
parentbb6c67bb36b136de10256f0999128df4a42f9ffc (diff)
lavfi: merge start_frame/draw_slice/end_frame
Any alleged performance benefits gained from the split are purely mythological and do not justify added code complexity.
Diffstat (limited to 'libavfilter/vsrc_color.c')
-rw-r--r--libavfilter/vsrc_color.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/libavfilter/vsrc_color.c b/libavfilter/vsrc_color.c
index 2bb07bf16e..c0a4e1c3b2 100644
--- a/libavfilter/vsrc_color.c
+++ b/libavfilter/vsrc_color.c
@@ -147,8 +147,6 @@ static int color_request_frame(AVFilterLink *link)
{
ColorContext *color = link->src->priv;
AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
- AVFilterBufferRef *buf_out;
- int ret;
if (!picref)
return AVERROR(ENOMEM);
@@ -157,29 +155,10 @@ static int color_request_frame(AVFilterLink *link)
picref->pts = color->pts++;
picref->pos = -1;
- buf_out = avfilter_ref_buffer(picref, ~0);
- if (!buf_out) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- ret = ff_start_frame(link, buf_out);
- if (ret < 0)
- goto fail;
-
ff_draw_rectangle(picref->data, picref->linesize,
color->line, color->line_step, color->hsub, color->vsub,
0, 0, color->w, color->h);
- ret = ff_draw_slice(link, 0, color->h, 1);
- if (ret < 0)
- goto fail;
-
- ret = ff_end_frame(link);
-
-fail:
- avfilter_unref_buffer(picref);
-
- return ret;
+ return ff_filter_frame(link, picref);
}
static const AVFilterPad avfilter_vsrc_color_outputs[] = {