[FFmpeg-devel] [PATCH] Make avfilter_graph_free() free the graph.

Michael Niedermayer michaelni
Tue Feb 1 21:15:17 CET 2011


On Tue, Feb 01, 2011 at 08:36:31PM +0100, Stefano Sabatini wrote:
> On date Tuesday 2011-02-01 20:29:03 +0100, Stefano Sabatini encoded:
> > Make avfilter_graph_free() free not only the internal structure, but
> > the allocated graph, simplify use.
> 
> > 
> > (Note to the committer: bump minor or at least micro).
> > ---
> >  ffmpeg.c                    |    5 +----
> >  ffplay.c                    |    1 -
> >  libavfilter/avfiltergraph.c |    1 +
> >  3 files changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index df89018..d2390bb 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -2698,10 +2698,7 @@ static int transcode(AVFormatContext **output_files,
> >          }
> >      }
> >  #if CONFIG_AVFILTER
> > -    if (graph) {
> > -        avfilter_graph_free(graph);
> > -        av_freep(&graph);
> > -    }
> > +    avfilter_graph_free(graph);
> >  #endif
> 
> This was required as previously the code was assuming that graph was a
> statically allocated struct.
> 

> Alternatively (safer) we could have:
> avfilter_graph_free(&graph)
> 
> for setting to NULL the graph pointer.

agree, and LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110201/622c3bac/attachment.pgp>



More information about the ffmpeg-devel mailing list