[MPlayer-dev-eng] [PATCH] Bugfix in subtitels recoding from stateful encodings

Guy Shapiro bugs at sguy.org
Mon May 26 21:13:56 CEST 2008


Hi,
When using the '-subcp' option to recode a stateful encoding (cp1255 in my 
case), the last letter of some subtitles are shown only at the start of the 
trailing subtitle.
You can reproduce the bug by playing the attached Srt file with the 
option '-subcp cp1255'. Instead of showing 3 characters in each subtitle, 
MPlayer moves the last letters of the Hebrew subtitles to the start of the 
non-Hebrew subtitles that come after them.
This bug is caused by the behaviour of iconv, that saves the encoding state 
between subtitles and sometimes put a character in the output buffer only 
after the character next to it is read from the input buffer.
The attached patch solves the problem for me.

Greetings,
Guy Shapiro
-------------- next part --------------
1
00:00:00,300 --> 00:00:02,280
àáâ

2
00:00:02,350 --> 00:00:04,830
abc

3
00:00:04,990 --> 00:00:07,070
àáâ

4
00:00:07,230 --> 00:00:08,790
123

5
00:00:09,350 --> 00:00:11,950
àáâ

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixrecode.patch
Type: text/x-diff
Size: 525 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080526/441551d5/attachment.patch>


More information about the MPlayer-dev-eng mailing list