62 if (!strstr(avctx->
extradata,
"\n[Events]"))
63 avio_printf(s->
pb,
"[Events]\r\nFormat: %s, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n",
97 av_log(s,
AV_LOG_DEBUG,
"wrote %d ASS lines, cached dialogues: %d, waiting for event id %d\n",
127 prev->
next = dialogue;
128 dialogue->
prev = prev;
134 next->
prev = dialogue;
135 dialogue->
next = next;
150 int hh1, mm1, ss1, ms1;
151 int hh2, mm2, ss2, ms2;
164 if (ass->
ssa_mode && !strncmp(p,
"Marked=", 7))
167 layer = strtol(p, &p, 10);
170 hh1 = (int)(start / 360000); mm1 = (int)(start / 6000) % 60;
171 hh2 = (int)(end / 360000); mm2 = (int)(end / 6000) % 60;
172 ss1 = (int)(start / 100) % 60; ms1 = (int)(start % 100);
173 ss2 = (int)(end / 100) % 60; ms2 = (int)(end % 100);
174 if (hh1 > 9) hh1 = 9, mm1 = 59, ss1 = 59, ms1 = 99;
175 if (hh2 > 9) hh2 = 9, mm2 = 59, ss2 = 59, ms2 = 99;
177 dialogue->
line =
av_asprintf(
"%s%ld,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s",
179 layer, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, p);
180 if (!dialogue->
line) {
199 #define OFFSET(x) offsetof(ASSContext, x)
200 #define E AV_OPT_FLAG_ENCODING_PARAM
202 {
"ignore_readorder",
"write events immediately, even if they're out-of-order",
OFFSET(ignore_readorder),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1,
E },
216 .mime_type =
"text/x-ssa",
217 .extensions =
"ass,ssa",
224 .priv_class = &ass_class,