diff options
Diffstat (limited to 'libavformat/rtpenc_mpegts.c')
-rw-r--r-- | libavformat/rtpenc_mpegts.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libavformat/rtpenc_mpegts.c b/libavformat/rtpenc_mpegts.c index f170f97934..8ad446b9dd 100644 --- a/libavformat/rtpenc_mpegts.c +++ b/libavformat/rtpenc_mpegts.c @@ -21,6 +21,7 @@ #include "libavutil/mathematics.h" #include "avformat.h" +#include "avio_internal.h" struct MuxChain { AVFormatContext *mpegts_ctx; @@ -33,11 +34,7 @@ static int rtp_mpegts_write_close(AVFormatContext *s) if (chain->mpegts_ctx) { av_write_trailer(chain->mpegts_ctx); - if (chain->mpegts_ctx->pb) { - uint8_t *buf; - avio_close_dyn_buf(chain->mpegts_ctx->pb, &buf); - av_free(buf); - } + ffio_free_dyn_buf(&chain->mpegts_ctx->pb); avformat_free_context(chain->mpegts_ctx); } if (chain->rtp_ctx) { @@ -101,11 +98,7 @@ static int rtp_mpegts_write_header(AVFormatContext *s) fail: if (mpegts_ctx) { - if (mpegts_ctx->pb) { - uint8_t *buf; - avio_close_dyn_buf(mpegts_ctx->pb, &buf); - av_free(buf); - } + ffio_free_dyn_buf(&chain->mpegts_ctx->pb); avformat_free_context(mpegts_ctx); } if (rtp_ctx) |