From 8e32b1f0963d01d4f5d4803eb721f162e0d58d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 24 Feb 2015 14:07:54 +0200 Subject: libavformat: Use ffio_free_dyn_buf where applicable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtpenc_mpegts.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'libavformat/rtpenc_mpegts.c') diff --git a/libavformat/rtpenc_mpegts.c b/libavformat/rtpenc_mpegts.c index f170f97..8ad446b 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) -- cgit v1.1