Commit 56a33b23 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_idet: flush internal buffers on parameter changes

This is needed to auto insert the filter by default
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 723c37d3
...@@ -249,6 +249,18 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) ...@@ -249,6 +249,18 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
return ff_filter_frame(ctx->outputs[0], picref); return ff_filter_frame(ctx->outputs[0], picref);
} }
if( picref->width != link->w
|| picref->height != link->h
|| picref->format != link->format) {
link->dst->inputs[0]->format = picref->format;
link->dst->inputs[0]->w = picref->width;
link->dst->inputs[0]->h = picref->height;
av_frame_free(&idet->prev);
av_frame_free(&idet->cur );
av_frame_free(&idet->next);
}
if (idet->prev) if (idet->prev)
av_frame_free(&idet->prev); av_frame_free(&idet->prev);
idet->prev = idet->cur; idet->prev = idet->cur;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment