[MPlayer-dev-eng] [PATCH] Fix attribute parsing at SRT subtitles

Stefan Pöschel basic.master at gmx.de
Thu Dec 31 14:37:54 CET 2015


Hi,

when SRT subtitles shall be displayed including formatting, they are
converted to ASS markup. The conversion therefore also processes the
"color" attribute of the HTML "font" tag.

At the moment unfortunately also affects attributes who just have
"color" as a prefix, e.g. the attribute "back-color" which is sometimes
contained in subtitles. Therefore the value of this background color
attribute is by mistake used to set the text color.

Please find attached a test SRT file (correct text color: white, not blue).

The attached patch fixes this parsing by also including the leading
space when recognizing the "color" attribute and also the other attributes.

Thanks and regards,
	Stefan Pöschel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_srt_attribute_test.srt
Type: application/x-subrip
Size: 112 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20151231/0a2fe28c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_srt_attribute_bugfix.patch
Type: text/x-patch
Size: 1773 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20151231/0a2fe28c/attachment-0001.bin>


More information about the MPlayer-dev-eng mailing list