diff options
author | jstebbins <[email protected]> | 2014-09-15 18:40:32 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-09-15 18:40:32 +0000 |
commit | 175bca7f24f6efee927d189122c8f90afea67ee8 (patch) | |
tree | 2d9db2716c135c0d0ace8be68a3b12b4c040f888 /libhb/decsrtsub.c | |
parent | 2526e8970cbe167f862f7681f19c07299cd3ef97 (diff) |
libhb: fix utf8/srt sub line ending parsing
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6408 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decsrtsub.c')
-rw-r--r-- | libhb/decsrtsub.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c index 5854138a3..e0e0f2d2b 100644 --- a/libhb/decsrtsub.c +++ b/libhb/decsrtsub.c @@ -178,7 +178,17 @@ void hb_srt_to_ssa(hb_buffer_t *sub_in, int line) hb_buffer_realloc(sub_in, pos + 4); // After realloc, sub_in->data may change ssa = (char*)sub_in->data; - if (srt[ii] == '\n') + if (srt[ii] == '\r') + { + ssa[pos++] = '\\'; + ssa[pos++] = 'N'; + ii++; + if (srt[ii] == '\n') + { + ii++; + } + } + else if (srt[ii] == '\n') { ssa[pos++] = '\\'; ssa[pos++] = 'N'; |