On date Monday 2011-06-13 10:17:04 -0400, Ronald S. Bultje encoded:
> Hi,
> 
> On Mon, Jun 13, 2011 at 5:23 AM, Anton Khirnov <[email protected]> wrote:
> > From: Michael Niedermayer <[email protected]>
> >
> > Signed-off-by: Anton Khirnov <[email protected]>
> > ---
> >  libavfilter/vf_scale.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
> > index 65fe01c..f3f32ab 100644
> > --- a/libavfilter/vf_scale.c
> > +++ b/libavfilter/vf_scale.c
> > @@ -205,6 +205,8 @@ static int config_props(AVFilterLink *outlink)
> >
> >     scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & 
> > PIX_FMT_PAL;
> >
> > +    if(scale->sws)
> > +        sws_freeContext(scale->sws);
> >     scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,
> 
> The if() isn't necessary, sws_freeContext already does that.
> 

> Does this mean config_props() can be repeatedly called without a
> cleanup by the filtering library? That seems like a bug. Stefano?

Indeed this patch is only due to the use in the vsrc_buffer, where the
scale filter is re-inited "by-hand", and would be unnecessary
otherwise. The vsrc_buffer change itself has been the subject of a
long discussion in various threads, we came to the conclusion that
we'll keep that solution, although somehow "hackish", until a better
solution is found.

That would mean either filtergraph reconfiguration, or move the
"normalization" in the app, which is problematic when direct rendering
is used, so from this point of view the current solution is
technically better. If you want more explanations I can try to find
the post on ffmpeg-devel where this was discussed.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to