[MPlayer-dev-eng] [PATCH] dynamic font generation

Arpi arpi at thot.banki.hu
Mon Aug 26 00:45:57 CEST 2002


Hi,

> > ye si know i should upgrade it, but since xfree 4.2.0 includes freetype 2.0
> > imho users also have 2.0 not 2.1
> > anyway teh only difference between 2.1 and 2.0 seems to be that 2.1 has
> > the get first/next char functions. but i doubt they are really required, at
> > least subfont-c works with my freetype 2.0 too.
> 
> fixed, but you currently can't use unicode with ft 2.0

i still don't understand why can't it work ithout first/next char functions.
you render the char when it first appears on teh screen, right?
so you can request glyph for the given unicode, and if it fails then no such
char, otherwise you got it.

> > anywya i've just applied your patches and it's still sig11ing for me (with
> > ft 2.0, the unicode routine using first/netxchat removed)
> 
> maybe fixed, but unless you send me the line where it crashed, I cannot be
> sure. sorry for the trouble but I wouldn't send this code if I didn't use it
> about a week without problems :)

yes, and sorry for that. i promised i'll look at it this weekend but was
busy with realaudio hacking and other things...

just tested this patch and still sig11's as soon as it wants to display any
osd:

(gdb) bt
#0  0x4046ec4d in memset (dstpp=0x0, c=0, len=2058904576)
    at ../sysdeps/i386/memset.c:64
#1  0x8099498 in render_one_glyph (desc=0x408f2008, c=16) at font_load_ft.c:527
#2  0x80978eb in vo_update_osd (dxs=640, dys=480) at sub.c:252
#3  0x809837d in vo_draw_text (dxs=640, dys=480,
    draw_alpha=0x80893a0 <draw_alpha>) at sub.c:621
#4  0x808a497 in draw_osd () at vo_xmga.c:192
#5  0x80a96e8 in control (vf=0x836bfb0, request=7, data=0x0) at vf_vo.c:55
#6  0x80a0a03 in decode_video (sh_video=0x836e230,
    start=0x84ea3d0 "\t{@Àñ\036\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx^\027\205áx"...,
    in_size=12314, drop_frame=0) at dec_video.c:229
#7  0x8069bf5 in main (argc=3, argv=0xbffff8a4, envp=0xbffff8b4)
    at mplayer.c:1589
#8  0x404152eb in __libc_start_main (main=0x8067538 <main>, argc=3,
    ubp_av=0xbffff8a4, init=0x8064dcc <_init>, fini=0x81e0c40 <_fini>,
    rtld_fini=0x4000c130 <_dl_fini>, stack_end=0xbffff89c)
    at ../sysdeps/generic/libc-start.c:129

looks like memset is called with NULL pointer from font_load_ft.c:527.

full output if matters:

MPlayer CVS-020826-00:08-2.95.3 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPU: Intel Pentium 4 Xeon Foster (Family: 8, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

Reading /root/.mplayer/codecs.conf: 38 audio & 106 video codecs
CommandLine:init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
 '-v' 'Coyote.Ugly.Sample-highbitrate-atmos.avi'
Using Linux's hardware RTC timing (1024Hz)
get_path('input.conf') -> '/root/.mplayer/input.conf'
Can't open input config file /root/.mplayer/input.conf : No such file or directory
Can't open input config file /usr/local/share/mplayer/input.conf : No such file or directory
Falling back on default (hardcoded) input config

Playing Coyote.Ugly.Sample-highbitrate-atmos.avi
Not an URL!
File size is 19185664 bytes
Detected AVI file format!
list_end=0x2292
list_end=0x10F4
======= AVI Header =======
us/frame: 40000  (fps=25.000)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (272) HAS_INDEX IS_INTERLEAVED
frames  total: 1913   initial: 0
streams: 2
Suggested BufferSize: 0
Size:  640 x 480
==> Found video stream: 0
found 'bih', 40 bytes of 40
======= STREAM Header =======
Type: vids   FCC: div3 (33766964)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 25/1 = 25.000
Start: 0   Len: 1913
Suggested BufferSize: 48632
Quality 5000
Sample size: 0
Regenerating keyframe table for DIVX 3 video
======= VIDEO Format ======
  biSize 40
  biWidth 640
  biHeight 480
  biPlanes 1
  biBitCount 24
  biCompression 861292868='DIV3'
  biSizeImage 921600
===========================
list_end=0x2186
==> Found audio stream: 1
found 'wf', 30 bytes of 20
======= STREAM Header =======
Type: auds   FCC:  (0)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 1
Rate: 16000/1 = 16000.000
Start: 0   Len: 1224320
Suggested BufferSize: 8000
Quality -1
Sample size: 1
list_end=0x2292
======= WAVE Format =======
Format Tag: 85 (0x55)
Channels: 2
Samplerate: 48000
avg byte/sec: 16000
Block align: 1
bits/sample: 0
cbSize: 12
mp3.wID=1
mp3.fdwFlags=0x2
mp3.nBlockSize=384
mp3.nFramesPerBlock=1
mp3.nCodecDelay=1393
Broken chunk?  chunksize=1382  (id=JUNK)
list_end=0x123CEF8
Found movie at 0x280C - 0x123CEF8
Reading INDEX block, 3815 chunks for 1913 frames
Broken chunk?  chunksize=0  (id=idx1)
Reading INDEX block, 3815 chunks for 1913 frames
AVI index offset: 0x2808 (movi=0x280C idx0=0x4 idx1=0x1F4C)
Auto-selected AVI audio ID = 1
Auto-selected AVI video ID = 0
AVI: Searching for audio stream (id:1)
AVI video length=17858876
VIDEO:  [DIV3]  640x480  24bpp  25.00 fps  1867.1 kbps (227.9 kbyte/s)
[V] filefmt:3  fourcc:0x33564944  size:640x480  fps:25.00  ftime:=0.0400
get_path('sub/') -> '/root/.mplayer/sub/'
Detected audio codec: [mp3] afm:1 (mp3lib MPEG layer-2, layer-3)
Initializing audio codec...
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer
mp3lib: made decode tables with MMX optimization
init layer2&3 finished, tables done
mp3lib: using MMX optimized decore!

MPEG 1.0, Layer III, 48000 Hz 128 kbit Joint-Stereo, BPF: 384
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0
AUDIO: 48000 Hz, 2 ch, sfmt: 0x10 (2 bps), ratio: 16000->192000 (128.0 kbit)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
INFO: libavcodec init OK!
libavcodec: CPU flags: mmx mmxext sse sse2
Detected video codec: [ffdivx] vfm:5 (FFmpeg DivX ;-) (MS MPEG-4 v3))
==========================================================================
AO: [oss] 48000Hz 2ch Signed 16-bit (Little-Endian)
AO: Description: OSS/ioctl audio output
AO: Author: A'rpi
ao2: 48000 Hz  2 chans  Signed 16-bit (Little-Endian)
audio_setup: using '/dev/dsp' dsp device
audio_setup: sample format: Signed 16-bit (Little-Endian) (requested: Signed 16-bit (Little-Endian))
audio_setup: using 2 channels (requested: 2)
audio_setup: using 48000 Hz samplerate (requested: 48000)
audio_setup: frags:  16/16  (4096 bytes/frag)  free:  65536
Start playing...
VDec: vo config request - 640 x 480 (preferred csp: Planar YV12)
vo_debug: query(Planar YV12) returned 0x437 (i=0) 
Movie-Aspect is undefined - no prescaling applied.
video_out->init(640x480->640x480,flags=0,'MPlayer',0x32315659)
VO: [xmga] 640x480 => 640x480 Planar YV12 
VO: Description: X11 (Matrox G200/G4x0/G550 overlay in window using /dev/mga_vid)
VO: Author: Zoltan Ponekker <pontscho at makacs.poliod.hu>
X11 opening display: :0.0
vo: X11 color mask:  FFFFFF  (R:FF0000 G:FF00 B:FF)
vo: X11 running at 1024x768 with depth 24 and 32 bpp (":0.0" => local display)
[xmga] x: 192 y: 144 w: 640 h: 480
[xmga] dcx: 198 dcy: 168 dx: 0 dy: 0 dw: 640 dh: 480
*** [vo] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
[mga] Using 3 buffers.
get_path('subfont.ttf') -> '/root/.mplayer/subfont.ttf'
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
[xmga] x: 0 y: 0 w: 640 h: 480
[xmga] dcx: 198 dcy: 168 dx: 0 dy: 0 dw: 640 dh: 480
A:   0.1 V:   0.0 A-V:  0.120 ct:  0.000    1/  1   0%  0%  0.0% 0 0 0%
XXX initial  v_pts=0.000  a_pos=8000 (0.500) 
*** [vo] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
A:   0.1 V:   0.0 A-V:  0.089 ct:  0.004    2/  2   0%  0%  0.0% 0 0 0%
A:   0.1 V:   0.1 A-V:  0.060 ct:  0.008    3/  3   0%  0%  0.0% 0 0 0%
A:   0.2 V:   0.1 A-V:  0.056 ct:  0.012    4/  4   0%  0%  0.0% 0 0 0%
A:   0.2 V:   0.2 A-V:  0.052 ct:  0.016    5/  5   0%  0%  0.0% 0 0 0%
A:   0.2 V:   0.2 A-V:  0.049 ct:  0.020    6/  6   0%  0%  0.0% 0 0 0%
A:   0.3 V:   0.2 A-V:  0.045 ct:  0.024    7/  7   0%  0%  0.0% 0 0 0%
A:   0.3 V:   0.3 A-V:  0.041 ct:  0.028    8/  8   0%  0%  0.0% 0 0 0%
A:   0.4 V:   0.3 A-V:  0.036 ct:  0.032    9/  9   0%  0%  0.0% 0 0 0%
A:   0.4 V:   0.4 A-V:  0.033 ct:  0.035   10/ 10   0%  0%  0.0% 0 0 0%
A:   0.4 V:   0.4 A-V:  0.029 ct:  0.038   11/ 11   0%  0%  0.0% 0 0 0%
A:   0.5 V:   0.4 A-V:  0.026 ct:  0.040   12/ 12   0%  0%  0.0% 0 0 0%
A:   0.5 V:   0.5 A-V:  0.024 ct:  0.043   13/ 13   0%  0%  0.0% 0 0 0%
A:   0.5 V:   0.5 A-V:  0.022 ct:  0.045   14/ 14  24%  1%  1.5% 0 0 0%
A:   0.6 V:   0.6 A-V:  0.020 ct:  0.047   15/ 15  23%  1%  1.5% 0 0 0%
A:   0.6 V:   0.6 A-V:  0.018 ct:  0.049   16/ 16  22%  1%  1.4% 0 0 0%
A:   0.7 V:   0.6 A-V:  0.016 ct:  0.050   17/ 17  22%  1%  1.4% 0 0 0%
A:   0.7 V:   0.7 A-V:  0.014 ct:  0.052   18/ 18  21%  1%  1.4% 0 0 0%
A:   0.7 V:   0.7 A-V:  0.013 ct:  0.053   19/ 19  21%  1%  1.3% 0 0 0%
A:   0.8 V:   0.8 A-V:  0.011 ct:  0.054   20/ 20  21%  1%  1.3% 0 0 0%
A:   0.8 V:   0.8 A-V:  0.010 ct:  0.055   21/ 21  20%  1%  1.3% 0 0 0%
A:   0.8 V:   0.8 A-V:  0.009 ct:  0.056   22/ 22  20%  1%  1.3% 0 0 0%
A:   0.9 V:   0.9 A-V:  0.008 ct:  0.057   23/ 23  20%  1%  1.3% 0 0 0%
A:   0.9 V:   0.9 A-V:  0.013 ct:  0.058   24/ 24  19%  0%  1.3% 0 0 0%
SEEK: i=976 (max:1001) dpos=319680 (wanted:320000)  
SEEK: idx=976  (a:976 v:1001)  v.skip=12  a.skip=320/0.000  


MPlayer interrupted by signal 11 in module: decode_video 

> > without having a sub font but having osd.pfb it doesn't display any osd
> > symbols. imho it should. we will supply osd font with mplayer but no ttf.
> 
> fixed, and osd font is now embedded in the binary

why?
imho copying it to the common data dir (along with codecs.conf) could be fine
anyway it's small compared to mplayer size so it doesn't matter :)


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list