* commit 'd371c3c2e2830d9783465ecfe1ab7d93351083b7': vf_frei0r: make config_props work properly when called multiple times. vf_gradfun: make config_props work properly when called multiple times. vf_lut: make config_props work properly when called multiple times. Conflicts: libavfilter/vf_lut.c Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n2.0
| @@ -353,6 +353,8 @@ static int config_input_props(AVFilterLink *inlink) | |||||
| AVFilterContext *ctx = inlink->dst; | AVFilterContext *ctx = inlink->dst; | ||||
| Frei0rContext *s = ctx->priv; | Frei0rContext *s = ctx->priv; | ||||
| if (s->destruct && s->instance) | |||||
| s->destruct(s->instance); | |||||
| if (!(s->instance = s->construct(inlink->w, inlink->h))) { | if (!(s->instance = s->construct(inlink->w, inlink->h))) { | ||||
| av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance\n"); | av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance\n"); | ||||
| return AVERROR(EINVAL); | return AVERROR(EINVAL); | ||||
| @@ -487,6 +489,8 @@ static int source_config_props(AVFilterLink *outlink) | |||||
| outlink->time_base = s->time_base; | outlink->time_base = s->time_base; | ||||
| outlink->sample_aspect_ratio = (AVRational){1,1}; | outlink->sample_aspect_ratio = (AVRational){1,1}; | ||||
| if (s->destruct && s->instance) | |||||
| s->destruct(s->instance); | |||||
| if (!(s->instance = s->construct(outlink->w, outlink->h))) { | if (!(s->instance = s->construct(outlink->w, outlink->h))) { | ||||
| av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance\n"); | av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance\n"); | ||||
| return AVERROR(EINVAL); | return AVERROR(EINVAL); | ||||
| @@ -168,6 +168,7 @@ static int config_input(AVFilterLink *inlink) | |||||
| int hsub = desc->log2_chroma_w; | int hsub = desc->log2_chroma_w; | ||||
| int vsub = desc->log2_chroma_h; | int vsub = desc->log2_chroma_h; | ||||
| av_freep(&s->buf); | |||||
| s->buf = av_mallocz((FFALIGN(inlink->w, 16) * (s->radius + 1) / 2 + 32) * sizeof(uint16_t)); | s->buf = av_mallocz((FFALIGN(inlink->w, 16) * (s->radius + 1) / 2 + 32) * sizeof(uint16_t)); | ||||
| if (!s->buf) | if (!s->buf) | ||||
| return AVERROR(ENOMEM); | return AVERROR(ENOMEM); | ||||
| @@ -221,6 +221,8 @@ static int config_props(AVFilterLink *inlink) | |||||
| int comp = s->is_rgb ? rgba_map[color] : color; | int comp = s->is_rgb ? rgba_map[color] : color; | ||||
| /* create the parsed expression */ | /* create the parsed expression */ | ||||
| av_expr_free(s->comp_expr[color]); | |||||
| s->comp_expr[color] = NULL; | |||||
| ret = av_expr_parse(&s->comp_expr[color], s->comp_expr_str[color], | ret = av_expr_parse(&s->comp_expr[color], s->comp_expr_str[color], | ||||
| var_names, funcs1_names, funcs1, NULL, NULL, 0, ctx); | var_names, funcs1_names, funcs1, NULL, NULL, 0, ctx); | ||||
| if (ret < 0) { | if (ret < 0) { | ||||