text: Fix handling of unbreakable-space in ssa subtitles

The character sequence \h is used for "unbreakable space".
Replace these sequences with space to avoid strings of \h
showing up on screen.
This commit is contained in:
Peter Bennett 2020-09-17 11:21:30 -04:00
parent 744c57c87d
commit efd5265e87

View File

@ -264,7 +264,8 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
String text =
SsaStyle.Overrides.stripStyleOverrides(rawText)
.replaceAll("\\\\N", "\n")
.replaceAll("\\\\n", "\n");
.replaceAll("\\\\n", "\n")
.replaceAll("\\\\h", " ");
Cue cue = createCue(text, style, styleOverrides, screenWidth, screenHeight);
int startTimeIndex = addCuePlacerholderByTime(startTimeUs, cueTimesUs, cues);