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

Бранко Мајић branko.majic at gmail.com
Wed Jun 13 10:22:21 CEST 2007


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 :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ass_stylename.patch
Type: text/x-diff
Size: 401 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070613/ad355972/attachment.patch>


More information about the MPlayer-dev-eng mailing list