1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

libavfilter: default to filter_frame when neither it nor start/slice/end is set.

this is needed for vf_null and a few others.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-29 02:03:20 +01:00
parent 60e50dd960
commit 015c2b4066

View File

@ -210,7 +210,7 @@ static int default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
if (inlink->dst->nb_outputs)
outlink = inlink->dst->outputs[0];
if (outlink && !inlink->dstpad->filter_frame) {
if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice)) {
AVFilterBufferRef *buf_out;
outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
if (!outlink->out_buf)
@ -332,8 +332,12 @@ static int default_end_frame(AVFilterLink *inlink)
int ret = inlink->dstpad->filter_frame(inlink, inlink->cur_buf);
inlink->cur_buf = NULL;
return ret;
} else {
} else if (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice){
return ff_end_frame(outlink);
} else {
int ret = ff_filter_frame(outlink, inlink->cur_buf);
inlink->cur_buf = NULL;
return ret;
}
}
return 0;
@ -366,7 +370,7 @@ static int default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
if (inlink->dst->nb_outputs)
outlink = inlink->dst->outputs[0];
if (outlink && !inlink->dstpad->filter_frame)
if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice))
return ff_draw_slice(outlink, y, h, slice_dir);
return 0;
}