[MPlayer-dev-eng] Real Audio/Video DLL for Mac OS X

Donnie Smith xc0bead2d8130df59 at f4n.org
Tue Jun 24 19:47:08 CEST 2003


Hi,

A year ago or so I briefely mentioned my attempts to implement 
Real Audio/Video DLL support for Mac OS X
(http://www.mplayerhq.hu/pipermail/mplayer-dev-eng/2002-August/010218.html).
The problem was mainly failure to get audio working, and I never
bothered to finish it. Wanting to use the new rtsp-implementation, I
decided to check it out again today, almost a year later :).

The error turned out to be really easy: raInitDecoder() wanted a
packed init-structure, just like Windows. I'm pretty sure I had some
video-issues last time I tried, but they seem to be gone now.

Since I only work with the mplayer source annually, I'd like someone
to help me with some design decisions:

1, Mac OS X supports different types of shared libraries, and Real uses
the "shlb" type (which isn't OS X native). Hence, is USE_MACSHLB
suitable as a companion to USE_WIN32DLL (if someone adds native shared
libraries for Mac OS X, they could be USE_MACDLL)?

2, Due to different calling conventions (as I said, shlb isn't the
format of choice for Mac OS X), one needs some extra code to be able
to call the shlb-functions (what you get from the GetProcAddress()
equivalent can't be called as function-pointer). I've implemented this
(using Apple's sample code) as a function, load_one_sym_mac(). Where's
the "correct" place to put it since it's needed by both vd_realaud.c
and ad_realaud.c? (Currently, both files are included if
USE_REALCODECS is defined, so putting it in either one should be fine,
but I'm not sure this is considered "clean".)

3, In ad_realaud.c preinit() (where a wra_init_t structure is
required), should I add yet another instance of the init-structure
(making there three in total), or should it be done with some 
creative #if:ing using the code that's already there?

I'll clean up the patch and submit it as soon as possible when the
questions above are answered.

I did experience one problem: the "new cache", USE_STREAM_CACHE,
appears to be broken for Mac OS X, at least for the Real files I
tried. I haven't been following the mailing list closely lately, so I'm
not sure if it's known. Anyhow, it "freezes" (no text input/output or
audio/video output) with the following backtrace (it calls
usec_sleep() repeatedly):

#0  0x90006ae8 in clock_sleep_trap ()
#1  0x0010b254 in usec_sleep ()
#2  0x000a5d98 in cache_read ()
#3  0x000a6588 in cache_stream_fill_buffer ()
#4  0x000c7d20 in demux_real_fill_buffer ()
#5  0x000a0dd8 in ds_fill_buffer ()
#6  0x000a5440 in demux_read_data ()
#7  0x0006a340 in decode_audio ()
#8  0x00045630 in decode_audio ()

I'm not familiar with the cache2 system, but sending the child
SIGINT restarts it and it's OK for another couple of
seconds/minutes (varies). #undef:ing USE_STREAM_CACHE makes it work
just fine (tested using CVS 2003-06-21). If it's not a known
bug/incompatibility/feature, I can look in to it more closely.

Somewhat unrelated: Is it possible to save a rtsp-stream (audio, cook)
as an .ra/.rm using mplayer?

Donnie Smith



More information about the MPlayer-dev-eng mailing list