Now metadata fields for source, copyright, lang and moreInformationURL are supported too. Evidence for the need of such support: https://docs.rs/dash-mpd/0.6.3/dash_mpd/struct.ProgramInformation.html and https://github.com/DroidFreak32/myjio_unrestrict/blob/805a8b48d02c5618608bf6fb2bfc2b450f1f057a/smali_classes2/com/google/android/exoplayer2/source/dash/manifest/ProgramInformation.smali#L19

Signed-off-by: Davy Durham <ddur...@users.sourceforge.net>
---
 libavformat/dashenc.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 295b01e225..e45eca3468 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1141,6 +1141,10 @@ static int write_manifest(AVFormatContext *s, int final)
     int use_rename = proto && !strcmp(proto, "file");
     static unsigned int warned_non_file = 0;
     AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0);
+ AVDictionaryEntry *source = av_dict_get(s->metadata, "source", NULL, 0); + AVDictionaryEntry *copyright = av_dict_get(s->metadata, "copyright", NULL, 0);
+    AVDictionaryEntry *lang = av_dict_get(s->metadata, "lang", NULL, 0);
+ AVDictionaryEntry *moreInformationURL = av_dict_get(s->metadata, "moreInformationURL", NULL, 0);
     AVDictionary *opts = NULL;
      if (!use_rename && !warned_non_file++)
@@ -1203,6 +1207,26 @@ static int write_manifest(AVFormatContext *s, int final)
         avio_printf(out, "\t\t<Title>%s</Title>\n", escaped);
         av_free(escaped);
     }
+    if (source) {
+        char *escaped = xmlescape(source->value);
+        avio_printf(out, "\t\t<Source>%s</Source>\n", escaped);
+        av_free(escaped);
+    }
+    if (copyright) {
+        char *escaped = xmlescape(copyright->value);
+        avio_printf(out, "\t\t<Copyright>%s</Copyright>\n", escaped);
+        av_free(escaped);
+    }
+    if (lang) {
+        char *escaped = xmlescape(lang->value);
+        avio_printf(out, "\t\t<lang>%s</lang>\n", escaped);
+        av_free(escaped);
+    }
+    if (moreInformationURL) {
+        char *escaped = xmlescape(moreInformationURL->value);
+ avio_printf(out, "\t\t<moreInformationURL>%s</moreInformationURL>\n", escaped);
+        av_free(escaped);
+    }
     avio_printf(out, "\t</ProgramInformation>\n");
      avio_printf(out, "\t<ServiceDescription id=\"0\">\n");
--
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to