[MPlayer-dev-eng] [PATCH] subcp_recode changes

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Oct 18 18:16:08 CEST 2006


Hello,
On Sun, Oct 15, 2006 at 10:47:38AM +0200, Reimar D?ffinger wrote:
> the attached patch changes subcp_recode in the following ways:
> 1) It allocates a buffer if 4* the input string before iconv. This wastes
>    quite a bit of memory but is IMHO better than the current, only 512
>    bytes big static buffer.
> 2) after failing to convert a line it will continue with the next
>    instead of not loading the subtitle at all. This may result in a lot
>    of "SUB: error recoding line." messages if -subcp is set wrong but
>    seems better to me than failing completely just because of one bogus
>    character.
> 3) check for icdsc == (iconv_t)(-1) and return in that case without
>    doing anything.
> 4) with all these changes I do not see why subcp_recode1 would be needed
>    and replaced it with subcp_recode. Somebody please test with an ogg
>    file with included subtitles, I do not have one.
>    This function must be changed anyway since it assumes that the
>    sub->text[l] buffers are 512 bytes large while in demux_ogg they are
>    only allocated with 128 bytes.
> 
> Also check that the following is correct:
> I did not check for an integer overflow at
> oleft = 4 * ileft;
> because that should not cause real problems, and oleft + 1 should not be
> possible to overflow because of the previous multiplication.
> Please test and comment.

Applied. Should also fix bug #600. The 512 bytes static buffer really was a bit small.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list