Effect plugin trouble

"Kumar Appaiah" <[email protected]> Tue, 6 Jun 2006 12:09:55 +0530
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
Dear XMMS list,

First of all, I want to say that XMMS is an excellent media player,
and we really love it!

Now, this is my first foray into making XMMS plugins. I am trying to
make a simple effect plugin, but I am facing some problems.

I do not have the code right now, but I will post it later if
required. Essentially, what I am doing is, initializing two buffers in
init(void) using g_malloc0 for past inputs and outputs. In
cleanup(void), if the buffers aren't NULL already, I g_free them and
set them to NULL. In mod_samples, I do some work and pass a pointer to
these buffers to another function which does some processing on them,
say process_samples.

Now, the plugin works fine when I enable it, play something, stop the
msuic and disable it. However, disabling it during play throws a
SIGSEGV in the function I call from mod_samples, viz. process_samples.
So, I tried using a semaphore variable which remained 1 during
processing, and 0 otherwise, and before cleanup, tried to wait till
processing ends. But that too didn't work.

Though I am not very aware about threads, I get the feeling XMMS
allows cleanup to free the buffers even while mod_samples is running.

Is there some mistake in what I am doing? If I haven't given
sufficient details, I will post the source tomorrow so that you can
have a look.

Thanks.

Kumar


-- 
Kumar Appaiah,
462, Jamuna Hostel,
Indian Insititute of Technology Madras,
Chennai - 600036