On Mon, 10 Feb 2014 13:05:42 +0200 (EET), Martin Storsjö <mar...@martin.st> 
wrote:
> On Tue, 4 Feb 2014, Anton Khirnov wrote:
> 
> > ---
> > libavformat/avformat.h |    3 ++-
> > libavformat/mux.c      |   25 ++++++++++++++++++-------
> > 2 files changed, 20 insertions(+), 8 deletions(-)
> 
> The change in general looks nice, but won't this lead to double frees for 
> all those callers that have made sure to free these packets in case of 
> error before? Not sure if anybody actually did that though.
> 

av_packet_unref() clears the packet, so unless the caller is keeping an extra
copy then it shouldn't break anything.

Besides, the alternative of not touching the packet on error would be quite
ugly, since the error may happen after we've passed the packet onward.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to