diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-19 07:36:27 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-19 08:03:57 +0300 |
commit | 56a33b232cbb71045fa6609fda3145ea08047b7d (patch) | |
tree | 6b334eefa7d5381fdf55bf1cacd7b72a6d3e8298 | |
parent | 723c37d3b7b5555f23bfdfe3e5c3599543c06332 (diff) |
avfilter/vf_idet: flush internal buffers on parameter changes
This is needed to auto insert the filter by default
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/vf_idet.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index 72729be833..c6ee8dbb33 100644 --- a/libavfilter/vf_idet.c +++ b/libavfilter/vf_idet.c @@ -249,6 +249,18 @@ static int filter_frame(AVFilterLink *link, AVFrame *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) av_frame_free(&idet->prev); idet->prev = idet->cur; |