[vorbis-dev] Ports

Brian Havard brianh at kheldar.apana.org.au
Tue Dec 26 02:36:45 PST 2000


On Sun, 24 Dec 2000 22:24:23, Michael Smith wrote:

>>>It's something that belongs externally to the program. (i.e. 'nice', or the equivalent on non-unix systems). You're welcome to have it in your own copy, but it isn't going into CVS. 
>>
>>The problem with that idea is that some systems (including OS/2 & I believe
>>Win9x/NT) have no equivalent of 'nice', at least not standard (not all the
>>world is unix). 
>
>Seems strange. Oh well. I suggest you just have it in your local copy (if you REALLY want it in the mainstream code, I'll accept an implementation that a) makes it optional, and b) implements it fully on all the supported OSes (win32, os/2, linux, freebsd, solaris, macosX, and probably a bunch of other unixes). If that looks like a lot - well, it is. I don't think it should be there.

Probably not as hard as you might think. Don't most unix(-like) systems
have the nice() system call?

>>>>I've got more now including an OS/2 ao plugin & a dl -> OS/2 API shim to
>>>>load it, making ogg123 work. I'll get it cleaned up & post it.
>>>
>>>That'd be good. Is there a good/well designed library for cross-platform dynamic loading, so we could just use that instead of a heap of platform-specific implementations? 
>>
>>The only one I know of (because I've been involved in its development) is
>>APR (see http://apr.apache.org/ ), an offshoot of the Apache Server
>>project.
>
>Yeah, APR looks very nice - but it's a big dependency to add for something like this. 

True, it'd be overkill for just module loading.

>>It's not that big a deal though, I've attached the dl for OS/2 code I wrote
>>just to show how simple it is. I could write one for Win32 just as easily.
>
>Yes - it isn't hard or complex, it's just messy to have a whole bunch of implementations. Not a big problem - going with platform-specific code is probably better (at least for now). The code looks fine, so I'll commit it once you've sent along the rest of the code (for libao os/2 output).

Ok, I've attached the full ao diff.

>>>>BTW, is http streaming in ogg123 supposed to work?
>>>
>>>Yes. I don't know if it does, though. It requires a high-speed connection, since it doesn't do anything nice like proper buffering, and it's quite likely to not work on non-unix systems. I haven't tested it in a long time, though, so it might not work any more.
>>
>>Ok, probably not worth worrying about for now. I tried it using an Apache
>>server running on the same machine & just got the "input not an Ogg Vorbis
>>audio stream" error.
>
>I just tested it (on a file from www.vorbis.com), and it works fine (well, it skipped a few times, because of the lack of buffering, but that's not a surprise). 
>
>Make sure your local webserver is specifying the correct mime type (application/x-ogg, I think) - some systems will break if it isn't set. That's my only guess for what's causing problems. Does OS/2 inherit the DOS stupidity of text/binary files? That would cause this if you don't have a mime type set.

The "text/binary" file thing has nothing to do with DOS, it's about
different line terminators. Any system that doesn't use the unix style LF
line terminator (pretty much anything non-unix) must translate text files.
DOS, OS/2 and Win32 all use CR/LF. Macs use CR. So it's necessary, not
stupid.

So yes, C libraries on OS/2 have text/binary file modes but I've checked
that ogg123 reads the http stream in binary mode. The fdopen in http_open()
specifies binary mode.

A few notes about the patch:
- in ao_wav.c the "#include <sys/types.h>" is to define off_t.
- I've added support for an optional AO_PLUGIN_PATH environment variable
allowing the plugin directory to be specified at runtime, making
distribution of binaries practical. I'm not sure if this is a good idea for
unix (setuid hole perhaps?).
- I've switched to using gcc instead of Watcom C as its more widely
available & free. It's also the only OS/2 compiler that supports fdopen()
on a socket, necessary for streaming.


-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh at kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------



<HR NOSHADE>
<UL>
<LI>application/octet-stream attachment: os2.patch
</UL>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: os2.patch
Type: application/octet-stream
Size: 14129 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20001226/693a089c/os2.obj


More information about the Vorbis-dev mailing list