[FFmpeg-devel] [PATCH] htmlsubtitles: support <br> tag

Michael Niedermayer michael at niedermayer.cc
Mon Jul 3 18:57:06 EEST 2017


On Mon, Jul 03, 2017 at 01:54:50PM +0200, Clément Bœsch wrote:
> On Mon, Jul 03, 2017 at 01:43:43PM +0200, wm4 wrote:
> > 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 | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/libavcodec/htmlsubtitles.c b/libavcodec/htmlsubtitles.c
> > index be5c9316ca..fe991678d5 100644
> > --- a/libavcodec/htmlsubtitles.c
> > +++ b/libavcodec/htmlsubtitles.c
> > @@ -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);
> 
> So this supports <br>, <   br > and <br/>?

i dont think this supports <br/> from a quick look


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170703/0c0a21c2/attachment.sig>


More information about the ffmpeg-devel mailing list