[MPlayer-dev-eng] [PATCH] improvement of sami subtitles feature

Jihyun Cho jihyun.jo at gmail.com
Thu Feb 14 08:18:16 CET 2013


2013/2/13 Diego Biurrun <diego at biurrun.de>

> On Fri, Jan 25, 2013 at 09:44:49AM +0900, Jihyun Cho wrote:
> >
> > I made a patch to improve a sami subtitles feature.
> > The patch includes two improvement.
> >  - Added a sami to ass markup converter. So mplayer can display colored
> > subtitles and other font attributes with -ass option.
> >  - Support html character entities. (eg. &, 가)
> >
> > Please see the screenshot and a subtitle sample below.
> > Screenshot: http://210.94.181.157/~jihyun/mplayer_sami.jpg
> > Subtitle sample: http://210.94.181.157/~jihyun/sample_sami.txt
>
> If you make two different changes, please separate them into different
> patches.
>
> > --- sub/subassconvert.c       (revision 35864)
> > +++ sub/subassconvert.c       (working copy)
> > @@ -528,3 +528,284 @@
> > --- sub/subreader.c   (revision 35864)
> > +++ sub/subreader.c   (working copy)
> > @@ -87,6 +87,31 @@
> >
> > +static const struct html_entity_conv {
> > +    const char *name;
> > +    const char *code;
> > +} sami_entities[] = {
> > +    {""", """}, {"'", "'"},
> > +    {"&", "&"}, {"<", "<"},
> > +    {">", ">"}, {"¡", "¡"},
> > +    {"¢", "¢"}, {"£", "£"},
> > +    {"¤", "¤"}, {"¥", "¥"},
> > +    {"¦", "¦"}, {"§", "§"},
> > +    {"¨", "¨"}, {"©", "©"},
> > +    {"ª", "ª"}, {"«", "«"},
> > +    {"¬", "¬"}, {"­", "­"},
> > +    {"®", "®"}, {"¯", "¯"},
> > +    {"°", "°"}, {"±", "±"},
> > +    {"&sup2;", "²"}, {"&sup3;", "³"},
> > +    {"´", "´"}, {"µ", "µ"},
> > +    {"¶", "¶"}, {"·", "·"},
> > +    {"¸", "¸"}, {"&sup1;", "¹"},
> > +    {"º", "º"}, {"»", "»"},
> > +    {"&frac14;", "¼"}, {"&frac12;", "½"},
> > +    {"&frac34;", "¾"}, {"¿", "¿"},
> > +    {"×", "×"}, {"÷", "÷"},
> > +};
>
> This table could benefit from some vertical alignment.
>
> > @@ -124,12 +149,144 @@
> >
> > +#ifdef CONFIG_ASS
> > +static subtitle *sub_ass_read_line_sami(stream_t* st, subtitle
> *current, int utf16) {
>
> { on the next line
>
>
I separated and trimmed the patch.
'mplayer_sami_ass_converter.patch' depends on
'mplayer_sami_html_character_entities.patch', because it uses sami_entities
table.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_sami_ass_converter.patch
Type: application/octet-stream
Size: 16328 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20130214/395a4287/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_sami_html_character_entities.patch
Type: application/octet-stream
Size: 3403 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20130214/395a4287/attachment-0003.obj>


More information about the MPlayer-dev-eng mailing list