mirror of
https://github.com/mpv-player/mpv
synced 2024-12-18 12:55:16 +00:00
Clear iconv conversion state after each subtitle line.
This fixes a bug when the last character on a subtitle line is sometimes moved to the beginning of the next line. Patch by Guy Shapiro, bugs sguy org. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26921 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
03a30e3a59
commit
f5a8ce6408
@ -1133,6 +1133,11 @@ subtitle* subcp_recode (subtitle *sub)
|
||||
free(ot);
|
||||
continue;
|
||||
}
|
||||
// In some stateful encodings, we must clear the state to handle the last character
|
||||
if (iconv(icdsc, NULL, NULL,
|
||||
&op, &oleft) == (size_t)(-1)) {
|
||||
mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: error recoding line, can't clear encoding state.\n");
|
||||
}
|
||||
*op='\0' ;
|
||||
free (sub->text[l]);
|
||||
sub->text[l] = ot;
|
||||
|
Loading…
Reference in New Issue
Block a user