]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avienc.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / avienc.c
index 3401cbc2375be601e8757573e812af0388d2b101..45f7a203da8e48cff9ffa2a71e2cdf0910a2d9b6 100644 (file)
@@ -26,6 +26,8 @@
 #include "avi.h"
 #include "avio_internal.h"
 #include "riff.h"
+#include "libavformat/avlanguage.h"
+#include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/dict.h"
 #include "libavutil/avassert.h"
@@ -309,6 +311,16 @@ static int avi_write_header(AVFormatContext *s)
             ff_riff_write_info_tag(s->pb, "strn", t->value);
             t = NULL;
         }
+        if(stream->codec_id == AV_CODEC_ID_XSUB
+           && (t = av_dict_get(s->streams[i]->metadata, "language", NULL, 0))) {
+            const char* langstr = av_convert_lang_to(t->value, AV_LANG_ISO639_1);
+            t = NULL;
+            if (langstr) {
+                char* str = av_asprintf("Subtitle - %s-xx;02", langstr);
+                ff_riff_write_info_tag(s->pb, "strn", str);
+                av_free(str);
+            }
+        }
       }
 
         if (pb->seekable) {
@@ -661,5 +673,4 @@ AVOutputFormat ff_avi_muxer = {
     .codec_tag         = (const AVCodecTag* const []){
         ff_codec_bmp_tags, ff_codec_wav_tags, 0
     },
-    .flags             = AVFMT_VARIABLE_FPS,
 };