Commit Graph

5 Commits

Author SHA1 Message Date
Martin Storsjö cf402d6fa8 rtpenc_mpegts: Set chain->rtp_ctx only after avformat_write_header succeeded
By making sure we at each time only have one pointer set, either a
local variable or one in the context, we avoid potential double frees
in the cleanup routines. If chain->rtp_ctx is set, it is closed by
calling avformat_write_trailer, but that shouldn't be called unless
avformat_write_header succeeded.

This issue was pointed out by Andreas Cadhalpun.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-10 09:58:41 +02:00
Martin Storsjö c83dd2d2a4 rtpenc_mpegts: Free the right ->pb in the error path in the init function
This fixes a typo from 8e32b1f096.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-10 09:58:37 +02:00
Martin Storsjö 8e32b1f096 libavformat: Use ffio_free_dyn_buf where applicable
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:47 +02:00
Martin Storsjö fc308b30bb rtpenc_mpegts: Call write_trailer for the mpegts muxer even if no output buffer exists
Since the mpegts muxer now can handle being called with a NULL
AVIOContext, we don't need to try to allocate one before calling
write_trailer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-19 23:14:45 +02:00
Martin Storsjö 8a70ef94b9 libavformat: Add a muxer wrapping mpegts encoding into RTP
Since this structurally is quite different from normal RTP
(multiple streams are muxed into one single mpegts stream,
which is packetized into one single RTP session), it is kept
as a separate muxer.

Since this structurally also behaves differently than normal
RTP, all of the other muxers that do chained RTP muxing
(rtsp, sap, mp4) would need to be updated similarly to handle
this - in particular, creating one single rtp_mpegts muxer
for the whole presentation instead of one rtp muxer per stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-18 23:12:33 +02:00