segment: Free and reinit the muxer before calling avformat_write_header
authorMartin Storsjö <martin@martin.st>
Wed, 3 Oct 2012 21:15:35 +0000 (00:15 +0300)
committerMartin Storsjö <martin@martin.st>
Thu, 4 Oct 2012 10:52:09 +0000 (13:52 +0300)
commiteb447d515956b3ce182d9750083131735f00324c
treec6d5c18ba9f283b987ddc1b3f888d82a5a551b0a
parent73871dc96ff78053b9dcd0eb259b7f5a5308ec87
segment: Free and reinit the muxer before calling avformat_write_header

This makes sure the muxers are set up in the way they expect
with no data left around from the previous run (which could
cause various issues including memory leaks, depending on the chaine
muxer).

This fixes memory leaks with the mpegts and flv muxers. It also
makes the usage of chained muxers correct.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/segment.c