summaryrefslogtreecommitdiffstats
path: root/libhb/decsrtsub.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-06-09 15:59:00 -0600
committerJohn Stebbins <[email protected]>2016-06-09 15:59:00 -0600
commit070bb1b3fca2011830fa1c08ab816d0859c83a97 (patch)
tree62314d216601314d0f3b90a0b67dd0f3658e7372 /libhb/decsrtsub.c
parenta40d3dca5cfa4f5e367eca8864caf777e09e773f (diff)
decsrt: don't add extra hard line break at end of subtitle
Diffstat (limited to 'libhb/decsrtsub.c')
-rw-r--r--libhb/decsrtsub.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c
index e4366f96b..8b2fa8585 100644
--- a/libhb/decsrtsub.c
+++ b/libhb/decsrtsub.c
@@ -180,18 +180,24 @@ void hb_srt_to_ssa(hb_buffer_t *sub_in, int line)
ssa = (char*)sub_in->data;
if (srt[ii] == '\r')
{
- ssa[pos++] = '\\';
- ssa[pos++] = 'N';
- ii++;
if (srt[ii] == '\n')
{
ii++;
}
+ if (srt[ii + 1] != 0)
+ {
+ ssa[pos++] = '\\';
+ ssa[pos++] = 'N';
+ }
+ ii++;
}
else if (srt[ii] == '\n')
{
- ssa[pos++] = '\\';
- ssa[pos++] = 'N';
+ if (srt[ii + 1] != 0)
+ {
+ ssa[pos++] = '\\';
+ ssa[pos++] = 'N';
+ }
ii++;
}
else