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"
42 "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding\r\n"
43 "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"
46 "Format: Layer, Start, End, Style, Text\r\n",
47 font, font_size, color, color, back_color, back_color,
48 -bold, -italic, -underline, alignment);
75 h = ts/360000; ts -= 360000*h;
76 m = ts/ 6000; ts -= 6000*
m;
77 s = ts/ 100; ts -= 100*
s;
78 av_bprintf(buf,
"%d:%02d:%02d.%02d,", h, m, s, ts);
87 if (!raw || raw == 2) {
92 dialog = strchr(dialog,
',');
98 layer = strtol(dialog, (
char**)&dialog, 10);
105 insert_ts(buf, duration == -1 ? -1 : ts_start + duration);
110 dlen = strcspn(dialog,
"\n");
111 dlen += dialog[dlen] ==
'\n';
121 int ts_start,
int duration,
int raw)
155 const char *linebreaks,
int keep_ass_markup)
157 const char *p_end = p +
size;
159 for (; p < p_end && *p; p++) {
162 if (linebreaks && strchr(linebreaks, *p)) {
167 }
else if (!keep_ass_markup && strchr(
"{}\\", *p)) {
176 }
else if (p[0] ==
'\n') {
180 }
else if (p[0] ==
'\r' && p < p_end - 1 && p[1] ==
'\n') {