30 const char *font,
int font_size,
31 int color,
int back_color,
32 int bold,
int italic,
int underline,
37 "ScriptType: v4.00+\r\n"
40 "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding\r\n"
41 "Style: Default,%s,%d,&H%x,&H%x,&H%x,&H%x,%d,%d,%d,1,1,0,%d,10,10,10,0,0\r\n"
44 "Format: Layer, Start, End, Style, Text\r\n",
45 font, font_size, color, color, back_color, back_color,
46 -bold, -italic, -underline, alignment);
73 h = ts/360000; ts -= 360000*h;
74 m = ts/ 6000; ts -= 6000*
m;
75 s = ts/ 100; ts -= 100*
s;
76 av_bprintf(buf,
"%d:%02d:%02d.%02d,", h, m, s, ts);
85 if (!raw || raw == 2) {
90 dialog = strchr(dialog,
',');
96 layer = strtol(dialog, (
char**)&dialog, 10);
103 insert_ts(buf, duration == -1 ? -1 : ts_start + duration);
108 dlen = strcspn(dialog,
"\n");
109 dlen += dialog[dlen] ==
'\n';
119 int ts_start,
int duration,
int raw)
153 const char *linebreaks,
int keep_ass_markup)
155 const char *p_end = p +
size;
157 for (; p < p_end && *p; p++) {
160 if (linebreaks && strchr(linebreaks, *p)) {
165 }
else if (!keep_ass_markup && strchr(
"{}\\", *p)) {
174 }
else if (p[0] ==
'\n') {
178 }
else if (p[0] ==
'\r' && p < p_end - 1 && p[1] ==
'\n') {