From 1338dc082354b87c0e26f7f2ab09df5964b7f993 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Fri, 4 Feb 2011 12:04:15 +0200 Subject: libavformat: Use avcodec_copy_context for chained muxers 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. Signed-off-by: Ronald S. Bultje --- libavformat/sapenc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat/sapenc.c') diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c index 088f7bda01..634f033d50 100644 --- a/libavformat/sapenc.c +++ b/libavformat/sapenc.c @@ -48,6 +48,8 @@ static int sap_write_close(AVFormatContext *s) url_fclose(rtpctx->pb); av_metadata_free(&rtpctx->streams[0]->metadata); av_metadata_free(&rtpctx->metadata); + av_free(rtpctx->streams[0]->codec->extradata); + av_free(rtpctx->streams[0]->codec); av_free(rtpctx->streams[0]->info); av_free(rtpctx->streams[0]); av_free(rtpctx); -- cgit v1.2.3