[MPlayer-dev-eng] [PATCH] improvement of sami subtitles feature
Diego Biurrun
diego at biurrun.de
Wed Feb 13 11:50:34 CET 2013
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[] = {
> + {""", """}, {"'", "'"},
> + {"&", "&"}, {"<", "<"},
> + {">", ">"}, {"¡", "¡"},
> + {"¢", "¢"}, {"£", "£"},
> + {"¤", "¤"}, {"¥", "¥"},
> + {"¦", "¦"}, {"§", "§"},
> + {"¨", "¨"}, {"©", "©"},
> + {"ª", "ª"}, {"«", "«"},
> + {"¬", "¬"}, {"", ""},
> + {"®", "®"}, {"¯", "¯"},
> + {"°", "°"}, {"±", "±"},
> + {"²", "²"}, {"³", "³"},
> + {"´", "´"}, {"µ", "µ"},
> + {"¶", "¶"}, {"·", "·"},
> + {"¸", "¸"}, {"¹", "¹"},
> + {"º", "º"}, {"»", "»"},
> + {"¼", "¼"}, {"½", "½"},
> + {"¾", "¾"}, {"¿", "¿"},
> + {"×", "×"}, {"÷", "÷"},
> +};
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
Diego
More information about the MPlayer-dev-eng
mailing list