[FFmpeg-devel] [PATCH 2/2] Deprecate sws_getContext(), use sws_alloc_context() and sws_init_context() instead.
Stefano Sabatini
stefano.sabatini-lala
Wed Sep 29 00:24:19 CEST 2010
On date Tuesday 2010-09-28 19:57:01 +0200, Michael Niedermayer encoded:
> On Tue, Sep 28, 2010 at 06:43:41PM +0200, Stefano Sabatini wrote:
> > On date Tuesday 2010-09-28 18:38:41 +0200, Stefano Sabatini encoded:
> > > ---
> > > swscale.h | 11 +++++++++++
> > > utils.c | 16 +++++++++++++---
> > > 2 files changed, 24 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/utils.c b/utils.c
> > > index c817a4d..826547d 100644
> > > --- a/utils.c
> > > +++ b/utils.c
> > [...]
> > > @@ -1564,9 +1566,17 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
> > > }
> > >
> >
> > > if (!context) {
> > > - return sws_getContext(srcW, srcH, srcFormat,
> > > - dstW, dstH, dstFormat, flags,
> > > - srcFilter, dstFilter, param);
> > > + if (!(context = sws_alloc_context()))
> > > + return NULL;
> > > + context->srcW = srcW;
> > > + context->srcH = srcH;
> > > + context->srcFormat = srcFormat;
> > > + context->dstFormat = dstFormat;
> > > + context->flags = flags;
> > > + context->param[0] = param[0];
> > > + context->param[1] = param[1];
> > > + if (sws_init_context(context, srcFilter, dstFilter) < 0)
> > > + return NULL;
> > > }
> > > return context;
> >
> > Fixed leak, updated.
> > --
> > FFmpeg = Fundamentalist and Formidable Marvellous Practical Ecumenical Guru
>
> > swscale.h | 11 +++++++++++
> > utils.c | 18 +++++++++++++++---
> > 2 files changed, 26 insertions(+), 3 deletions(-)
> > 6ae71331a92835f36cf8bd83e45a0a32948ce81b 0002-Deprecate-sws_getContext-use-sws_alloc_context-and.patch
> > From 0d0f2d2638a25110c8e26d751f6a03b49eeee52c Mon Sep 17 00:00:00 2001
>
> ok (if tested)
Applied.
--
FFmpeg = Free Frightening Mastering Peaceful Extreme Ghost
More information about the ffmpeg-devel
mailing list