X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtpenc_mpegts.c;h=7d7377db7a51f8994c10cbf881c508c759bc3ea5;hb=2e7752affff242030edd016946289dc55eb0d617;hp=5f81e1a14533ac3a8a71e9157654ebc7081d432e;hpb=203bbaccfaaeac9548862e83792d38509a8c8167;p=ffmpeg diff --git a/libavformat/rtpenc_mpegts.c b/libavformat/rtpenc_mpegts.c index 5f81e1a1453..7d7377db7a5 100644 --- a/libavformat/rtpenc_mpegts.c +++ b/libavformat/rtpenc_mpegts.c @@ -48,8 +48,8 @@ static int rtp_mpegts_write_header(AVFormatContext *s) { struct MuxChain *chain = s->priv_data; AVFormatContext *mpegts_ctx = NULL, *rtp_ctx = NULL; - AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL); - AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); + ff_const59 AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL); + ff_const59 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); int i, ret = AVERROR(ENOMEM); AVStream *st; @@ -60,6 +60,7 @@ static int rtp_mpegts_write_header(AVFormatContext *s) return AVERROR(ENOMEM); mpegts_ctx->oformat = mpegts_format; mpegts_ctx->max_delay = s->max_delay; + av_dict_copy(&mpegts_ctx->metadata, s->metadata, 0); for (i = 0; i < s->nb_streams; i++) { AVStream* st = avformat_new_stream(mpegts_ctx, NULL); if (!st) @@ -102,10 +103,10 @@ static int rtp_mpegts_write_header(AVFormatContext *s) fail: if (mpegts_ctx) { ffio_free_dyn_buf(&mpegts_ctx->pb); + av_dict_free(&mpegts_ctx->metadata); avformat_free_context(mpegts_ctx); } - if (rtp_ctx) - avformat_free_context(rtp_ctx); + avformat_free_context(rtp_ctx); rtp_mpegts_write_close(s); return ret; }