-#if FF_API_ASS_TIMING
- if (!strncmp(ass, "Dialogue: ", 10)) {
- if (i > 0) {
- av_log(avctx, AV_LOG_ERROR, "ASS encoder supports only one "
- "ASS rectangle field.\n");
- return AVERROR_INVALIDDATA;
- }
-
- ass += 10; // skip "Dialogue: "
- /* parse Layer field. If it's a Marked field, the content
- * will be "Marked=N" instead of the layer num, so we will
- * have layer=0, which is fine. */
- layer = strtol(ass, &p, 10);
-
-#define SKIP_ENTRY(ptr) do { \
- char *sep = strchr(ptr, ','); \
- if (sep) \
- ptr = sep + 1; \
-} while (0)
-
- SKIP_ENTRY(p); // skip layer or marked
- SKIP_ENTRY(p); // skip start timestamp
- SKIP_ENTRY(p); // skip end timestamp
- snprintf(ass_line, sizeof(ass_line), "%d,%ld,%s", ++s->id, layer, p);
- ass_line[strcspn(ass_line, "\r\n")] = 0;
- ass = ass_line;
- }
-#endif
-