[vorbis] Winamp plugin compile problems and fix/docs

Michael Smith msmith at labyrinth.net.au
Mon May 22 22:38:16 PDT 2000



At 07:45 PM 5/22/00 -0700, you wrote:
>The winamp plugin would not compile. I am using the Cygnus environment
>(gcc, and a lot of other GNU utils)
>on Windows NT.
>
>_beginthread() is not found. That doesn't look like a function
>application code should ever call directly.

The plugin used to use CreateThread, etc. Then I changed this after finding
the following (from the MSVC docs)

"A thread that uses functions from the C run-time libraries should use 
 the beginthread and endthread C run- time functions for thread management
 rather than CreateThread and ExitThread. Failure to do so results in 
 small memory leaks when ExitThread is called."

It's not entirely clear whether this is critical, since we don't ever
actually call ExitThread() explicitly, we just return from the thread's
main function. (The C run-time library is used extensively in libvorbis,
and used to be used directly from the plugin)
The reason it doesn't work for you (with cygwin) is probably the prepended
underscore which MSVC appeared to need. Of course, using CreateThread()
works fine - it just might leak memory.

>
>I converted it to use CreateThread and it compiles and works.
>
>Change this:
>
>thread_handle = (HANDLE)_beginthread(DecodeThread,0, (void *)(&killDecod
>
>eThread) );
>
>To this:
>
>thread_handle = (HANDLE)CreateThread(NULL,0,DecodeThread,(void *)(&killD
>
>ecodeThread),0,0);
>
>and then it works. No guarantees at all that this is correct and no
>warranty if it breaks anything.
>
>I have a working DLL now. Should I give it to anyone? There aren't any
>copyright issues due to third-party code
>getting linked in, are there?

You can if you want to. I'm the not-at-all-official maintainer of the
winamp plugin, and I've been occasionally putting up binary versions of the
winamp plugin (http://www.labyrinth.net.au/~msmith/in_vorbis.dll - should
closely match the version in cvs).

>
>BTW this is what I had to do. The following documentation is far from
>perfect, but hopefully helpful.
>
>Put vorbis stuff in c:\vorbis
>Put the winamp input sdk in there too.
>Install Cygnus environment (from sourceware.cygnus.com).
>Run bash.
>mount -b c:\vorbis /vorbis (yes, there really is a mount command.)
>./configure as usual
>compile vorbis.c in winamp directory with gcc -c
>link the dll with gcc --shared vorbis.o pathtolibvorbis.a
>pathtovorbisfile.a
>put the dll in the winamp plugins directory as in_vorbis.dll
>
>It seems to work. A song I encoded with the example_encoder (actually I
>used a script I listed in a previous message
>to call the encoder) plays fine. Weird rate (151 Kbps). Title is "Song
>encoded with example_encoder.c" or something
>of that nature. Other than that it's ok.

The title generation is fairly basic in the current version. My local
version (of both the winamp and xmms plugins) generates a title from TITLE
and ARTIST 'tags' in the comments section, if present. Of course, this
means using an encoder which generates these appropriately, and/or a
comment section editor (I have both of these - they're not in 'releasable'
state, but I'll send them to anyone who cares)

>
>Now if I could only find the freeamp and xmms plugins. Even if they
>aren't done, please open source them now.
>Vorbis and the winamp plugin aren't technically done, but that hasn't
>stopped them from working for me. :)

Xmms plugin is in vorbis cvs. There's one little bug there which I need to
fix - that'll get committed some time today. The freeamp plugin is
available from freeamp cvs.

Michael

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list