[MPlayer-dev-eng] [PATCH] repost: array initialization fix in font_load.c

SungKwan Kang ksquarekr at yahoo.com
Fri Jun 18 04:52:05 CEST 2004


Thank you for reviewing this. I think this patch
doesn't slow things down, because:
1) read_font_desc() function where this array
initialization happens is called very rarely. It's
called once or twice in main() for non-GUI version and
once during the initialization and each time user
changes font settings for GUI version.
2) It's just assigning three variables in the loop, so
changing the number of iteration from 512 to 65536
won't make any noticable difference.
Please consider to apply this change. It makes problem
in 2-byte font display.

Thanks,
ksquarekr

--- Reimar_Döffinger
<Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> Hi,
> 
> > This small patch fixes array initialization bug in
> font_load.c.
> > 
> > Number of entries of 'font', 'start', and 'width'
> arrays are all 65536
> > as defined in libvo/font_load.h but only the first
> 512 entries were
> > being initialized in read_font_desc() function.
> > 
> > This makes problem in displaying 2-bytes
> characters. Fixed this by
> > changing 512 to 65536 in two places. The only file
> affected is
> > libvo/font_load.c and I didn't see any side
> effects of this change.
> 
> this seems correct to me. Any comments?
> I dislike the fact that it makes this function quite
> a bit slower (is 
> this important?).
> And I also saw that the font_desc_t struct
> (fontdesc.h, line 19) is more 
> than 512k big! Wouldn't it make more sense to
> allocate the font, start, 
> width etc. array dynamically with a size that makes
> sense (there are 
> probably quite a few people that don't need
> unicode...)
> Does anyone know this code?
> 
> Greetings,
> Reimar Döffinger
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 




More information about the MPlayer-dev-eng mailing list