mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
5a13d47b97
commit
3e0a270559
|
@ -88,7 +88,7 @@ static const struct tag_conv {
|
||||||
{"<u>", "{\\u1}"}, {"</u>", "{\\u0}"},
|
{"<u>", "{\\u1}"}, {"</u>", "{\\u0}"},
|
||||||
{"<s>", "{\\s1}"}, {"</s>", "{\\s0}"},
|
{"<s>", "{\\s1}"}, {"</s>", "{\\s0}"},
|
||||||
{"{", "\\{"}, {"}", "\\}"},
|
{"{", "\\{"}, {"}", "\\}"},
|
||||||
{"\n", "\\N"}
|
{"\r\n", "\\N"}, {"\n", "\\N"}, {"\r", "\\N"},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
|
|
Loading…
Reference in New Issue