]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avienc.c
yuv4mpeg: Correctly round chroma up for odd luma sizes
[ffmpeg] / libavformat / avienc.c
index fa6321200ec68ab4a941597d269a83b72e8b6125..9d1f5102a14e28a700f98fcb30a7bff43ab4ae29 100644 (file)
@@ -105,19 +105,6 @@ static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
     return tag;
 }
 
-static void avi_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
-{
-    int len = strlen(str);
-    if (len > 0) {
-        len++;
-        ffio_wfourcc(pb, tag);
-        avio_wl32(pb, len);
-        avio_put_str(pb, str);
-        if (len & 1)
-            avio_w8(pb, 0);
-    }
-}
-
 static int avi_write_counters(AVFormatContext* s, int riff_id)
 {
     AVIOContext *pb = s->pb;
@@ -300,7 +287,7 @@ static int avi_write_header(AVFormatContext *s)
         }
         ff_end_tag(pb, strf);
         if ((t = av_dict_get(s->streams[i]->metadata, "title", NULL, 0))) {
-            avi_write_info_tag(s->pb, "strn", t->value);
+            ff_riff_write_info_tag(s->pb, "strn", t->value);
             t = NULL;
         }
       }
@@ -377,14 +364,7 @@ static int avi_write_header(AVFormatContext *s)
 
     ff_end_tag(pb, list1);
 
-    list2 = ff_start_tag(pb, "LIST");
-    ffio_wfourcc(pb, "INFO");
-    ff_metadata_conv(&s->metadata, ff_riff_info_conv, NULL);
-    for (i = 0; *ff_riff_tags[i]; i++) {
-        if ((t = av_dict_get(s->metadata, ff_riff_tags[i], NULL, AV_DICT_MATCH_CASE)))
-            avi_write_info_tag(s->pb, t->key, t->value);
-    }
-    ff_end_tag(pb, list2);
+    ff_riff_write_info(s);
 
     /* some padding for easier tag editing */
     list2 = ff_start_tag(pb, "JUNK");