avformat/rtpenc_mpegts: copy metadata to mpegts sub-muxer
authorMoritz Barsnick <barsnick@gmx.net>
Mon, 2 Jul 2018 11:38:04 +0000 (13:38 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 20 Sep 2019 21:26:34 +0000 (23:26 +0200)
Fixes #7293.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/rtpenc_mpegts.c

index 969dbff..45ba6ff 100644 (file)
@@ -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,6 +103,7 @@ 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)