[FFmpeg-devel] [PATCH 2/6] libavformat: Use avcodec_copy_context for chained muxers

Martin Storsjö martin
Thu Feb 3 15:50:31 CET 2011


On Thu, 3 Feb 2011, Ronald S. Bultje wrote:

> On Thu, Feb 3, 2011 at 7:10 AM, Martin Storsj? <martin at martin.st> wrote:
> > This avoids having the chained AVStream->codec point to the same
> > AVCodecContext owned by the outer AVStream. The downside is that
> > changes to the AVCodecContext made after calling av_write_header
> > cannot be detected automatically within the chained muxer.
> >
> > This avoids having to manually unlink the chained AVStream->codec
> > by setting it to null before freeing the chained muxer via generic
> > freeing functions.
> > ---
> > ?libavformat/movenchint.c ? | ? ?9 +++++----
> > ?libavformat/rtpenc_chain.c | ? ?8 +++-----
> > ?libavformat/rtsp.c ? ? ? ? | ? ?2 ++
> > ?libavformat/sapenc.c ? ? ? | ? ?2 ++
> > ?4 files changed, 12 insertions(+), 9 deletions(-)
> 
> This looks OK. You've checked this using valgrind to ensure we're not
> introducing new memleaks here, right?

Yes, I valgrinded all of these quite thoroughly.

// Martin



More information about the ffmpeg-devel mailing list