lavfi: unref AVFilterLink.out_buf in ff_end_frame().

This reduces code duplication and prevents stale pointers from remaining
on the link.
This commit is contained in:
Anton Khirnov 2012-07-14 17:09:43 +02:00
parent 07bad27810
commit 4c9080a7ef
10 changed files with 1 additions and 13 deletions

View File

@ -260,7 +260,6 @@ static void end_frame(AVFilterLink *inlink)
ff_draw_slice(outlink, 0, inlink->h, 1);
ff_end_frame(outlink);
avfilter_unref_buffer(outpicref);
}
AVFilter avfilter_vf_delogo = {

View File

@ -213,7 +213,6 @@ static void end_frame(AVFilterLink *inlink)
}
ff_end_frame(outlink);
avfilter_unref_bufferp(&outlink->out_buf);
}
AVFilter avfilter_vf_fieldorder = {

View File

@ -354,7 +354,6 @@ static void end_frame(AVFilterLink *inlink)
(uint32_t *)outpicref->data[0]);
ff_draw_slice(outlink, 0, outlink->h, 1);
ff_end_frame(outlink);
avfilter_unref_buffer(outpicref);
}
AVFilter avfilter_vf_frei0r = {

View File

@ -225,7 +225,6 @@ static void end_frame(AVFilterLink *inlink)
ff_draw_slice(outlink, 0, inlink->h, 1);
ff_end_frame(outlink);
avfilter_unref_buffer(outpic);
}
AVFilter avfilter_vf_gradfun = {

View File

@ -322,7 +322,6 @@ static void end_frame(AVFilterLink *inlink)
ff_draw_slice(outlink, 0, inpic->video->h, 1);
ff_end_frame(outlink);
avfilter_unref_buffer(outpic);
}
AVFilter avfilter_vf_hqdn3d = {

View File

@ -367,7 +367,6 @@ static void end_frame(AVFilterLink *inlink)
ff_draw_slice(outlink, 0, outlink->h, 1);
ff_end_frame(outlink);
avfilter_unref_buffer(outpicref);
}
AVFilter avfilter_vf_ocv = {

View File

@ -347,7 +347,6 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
static void end_frame(AVFilterLink *link)
{
ff_end_frame(link->dst->outputs[0]);
avfilter_unref_buffer(link->dst->outputs[0]->out_buf);
}
static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, int before_slice)

View File

@ -194,7 +194,6 @@ static void end_frame(AVFilterLink *inlink)
ff_draw_slice(outlink, 0, outpic->video->h, 1);
ff_end_frame(outlink);
avfilter_unref_buffer(outpic);
}
AVFilter avfilter_vf_transpose = {

View File

@ -227,7 +227,6 @@ static void end_frame(AVFilterLink *link)
ff_draw_slice(link->dst->outputs[0], 0, link->h, 1);
ff_end_frame(link->dst->outputs[0]);
avfilter_unref_buffer(out);
}
static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)

View File

@ -225,10 +225,6 @@ static void default_end_frame(AVFilterLink *inlink)
outlink = inlink->dst->outputs[0];
if (outlink) {
if (outlink->out_buf) {
avfilter_unref_buffer(outlink->out_buf);
outlink->out_buf = NULL;
}
ff_end_frame(outlink);
}
}
@ -249,6 +245,7 @@ void ff_end_frame(AVFilterLink *link)
link->src_buf = NULL;
}
avfilter_unref_bufferp(&link->cur_buf);
avfilter_unref_bufferp(&link->out_buf);
}
void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)