[vorbis-dev] XMMS plugin update

Monty xiphmont at xiph.org
Sat Nov 13 10:05:41 PST 1999



> Most other plugins handle this by having a call from xmms set a global
> variable which the thread doing the playback checks.  This variable gives
> the location to seek to, so the actual decoding is all still handled by a
> single thread.

Ah, that is a simple solution, yes.  (I'll note that simply setting a global
variable is *not* strictly thread safe by POSIX.  Even a simple 'x=1;' is never
guaranteed to be a single machine instruction. It's unlikely to be a problem,
but a 1 in 1,000,000,000 chance of failure means a crash every couple seconds
:-)

I have a comment to that effect in the plugin code.

> Using global variables in this fashion creates a module which is not
> thread-safe itself, and may break some features which are being
> implemented in the xmms CVS source right now (preplay, for example)
> But at least for the short term I think this is a suitable way of doing
> things.

"hm."  I'll note that locking vorbisfile is not a difficult thing to do.

Monty

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list