[MPlayer-cvslog] r34845 - trunk/sub/subassconvert.c

cboesch subversion at mplayerhq.hu
Sat Apr 7 13:17:10 CEST 2012

Author: cboesch
Date: Sat Apr  7 13:17:09 2012
New Revision: 34845

subassconvert: handle "\r\n" line ends

Previously the code converting text subtitles to ASS format converted newline
characters, and only those, to ASS "new line" markup. If the subtitles
contained "\r\n", the "\r" was thus left in the text. In previous libass
versions the "\r" was not visible, but in the current one it produces an empty
box. Improve the conversion to remove the "\r" in that case. Also treat a lone
"\r" as a newline.

Picked from mplayer2/3e0a2705


Modified: trunk/sub/subassconvert.c
--- trunk/sub/subassconvert.c	Sat Apr  7 02:10:27 2012	(r34844)
+++ trunk/sub/subassconvert.c	Sat Apr  7 13:17:09 2012	(r34845)
@@ -86,7 +86,7 @@ static const struct tag_conv {
     {"<u>", "{\\u1}"}, {"</u>", "{\\u0}"},
     {"<s>", "{\\s1}"}, {"</s>", "{\\s0}"},
     {"{", "\\{"}, {"}", "\\}"},
-    {"\n", "\\N"}
+    {"\r\n", "\\N"}, {"\n", "\\N"}, {"\r", "\\N"},
 static const struct {

More information about the MPlayer-cvslog mailing list