avformat/assenc: mux an event header if none are found in extradata
authorClément Bœsch <u@pkh.me>
Sat, 20 Sep 2014 19:37:01 +0000 (21:37 +0200)
committerClément Bœsch <u@pkh.me>
Sat, 27 Sep 2014 15:32:14 +0000 (17:32 +0200)
libavformat/assenc.c

index 13af86e..8593b6c 100644 (file)
@@ -54,6 +54,8 @@ static int write_header(AVFormatContext *s)
         if (avctx->extradata[avctx->extradata_size - 1] != '\n')
             avio_write(s->pb, "\r\n", 2);
     }
+    if (!strstr(avctx->extradata, "\n[Events]"))
+        avio_printf(s->pb, "[Events]\r\nFormat: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text\r\n");
     avio_flush(s->pb);
 
     return 0;