htmlsubtitles: support <br> tag
authorwm4 <nfxjfg@googlemail.com>
Mon, 3 Jul 2017 11:42:44 +0000 (13:42 +0200)
committerwm4 <nfxjfg@googlemail.com>
Thu, 6 Jul 2017 08:04:55 +0000 (10:04 +0200)
Some .srt files use this tag.

(An alternative implementation would be correctly ignoring unknown tags,
and treating them as whitespace. libass can do automatic line wrapping.)

libavcodec/htmlsubtitles.c

index be5c931..fe99167 100644 (file)
@@ -167,6 +167,8 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
                         }
                     } else if (tagname[0] && !tagname[1] && strspn(tagname, "bisu") == 1) {
                         av_bprintf(dst, "{\\%c%d}", tagname[0], !tag_close);
+                    } else if (!strcmp(tagname, "br")) {
+                        av_bprintf(dst, "\\N");
                     } else {
                         unknown = 1;
                         snprintf(tmp, sizeof(tmp), "</%s>", tagname);