]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/asf.c
Make write_header() and write_headers() return an error code in case of
[ffmpeg] / libavformat / asf.c
index 4ce1f7f718be2e363ccfab41a610ecfb4ec4be44..e25ac030aaac0eaf3db07bdf8a0134e86094cd4c 100644 (file)
@@ -106,6 +106,10 @@ const ff_asf_guid ff_asf_metadata_header = {
         0xea, 0xcb, 0xf8, 0xc5, 0xaf, 0x5b, 0x77, 0x48, 0x84, 0x67, 0xaa, 0x8c, 0x44, 0xfa, 0x4c, 0xca
 };
 
+const ff_asf_guid ff_asf_marker_header = {
+        0x01, 0xCD, 0x87, 0xF4, 0x51, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
+};
+
 /* I am not a number !!! This GUID is the one found on the PC used to
    generate the stream */
 const ff_asf_guid ff_asf_my_guid = {
@@ -131,7 +135,7 @@ const ff_asf_guid ff_asf_digital_signature = {
 /* List of official tags at http://msdn.microsoft.com/en-us/library/dd743066(VS.85).aspx */
 const AVMetadataConv ff_asf_metadata_conv[] = {
     { "WM/AlbumArtist"     , "album_artist"},
-    { "WM/AlbumTitle"      , "album  "     },
+    { "WM/AlbumTitle"      , "album"       },
     { "Author"             , "artist"      },
     { "Description"        , "comment"     },
     { "WM/Composer"        , "composer"    },
@@ -148,3 +152,20 @@ const AVMetadataConv ff_asf_metadata_conv[] = {
 //  { "Year"               , "date"        }, TODO: conversion year<->date
     { 0 }
 };
+
+int ff_put_str16_nolen(ByteIOContext *s, const char *tag)
+{
+    const uint8_t *q = tag;
+    int ret = 0;
+
+    while (*q) {
+        uint32_t ch;
+        uint16_t tmp;
+
+        GET_UTF8(ch, *q++, break;)
+        PUT_UTF16(ch, tmp, put_le16(s, tmp);ret += 2;)
+    }
+    put_le16(s, 0);
+    ret += 2;
+    return ret;
+}