[MPlayer-dev-eng] [PATCH] Allow '=' and '.' characters in style names for -ass-force-style

Evgeniy Stepanov eugeni.stepanov at gmail.com
Sat Jun 16 00:30:37 CEST 2007


On Wednesday 13 June 2007, Бранко Мајић wrote:
> According to the specification of the ASS subtitle (see
> http://people.ee.ethz.ch/~adogan/ass-specs.ps.gz if interested), the style
> name can consist of any character, except the comma (,). This means that
> style name can also consist of dots (.) and equality (=) signs.
> -ass-force-style uses commas, dots, and equality signs in its arguments to
> delimiter its multiple parameters (which means we have no problems with
> commas). Current code that does parsing doesn't work correctly if the style
> name contains dots or equality signs. This patch should fix this situation,
> by searching for these characters backwards (using strrchr function instead
> of strchr). The only problematic situation after this might be the fact
> that even some of the font names could also use equality signs or dots
> (haven't ever run into this one, though).
>
> Here's an example of what this patch actually fixes:
> 1) .hack.FontSize=20
> 2) style=name.FontSize=30
>
> In first case the style name is .hack, but the current parsing function
> will stop at first dot, and will assume that style name is actually empty,
> which is incorrect (this is actually a real-life problem I had).
> In second case the parsing function will seek for first equality sign and
> presume that the property(+style) being changed is named style, while the
> actual name is style=name.
>
> P.S.
> Sorry if my explanation is too long, but it was hard for me to describe it
> in fewer lines :)

Applied. It would be better to use some kind of escaping, but probably not 
worth the effort. After all, it is a debugging option, and such fonts are 
quite rare (never seen one).



More information about the MPlayer-dev-eng mailing list