[pulseaudio-discuss] sink-input.c: pa_sink_input_new vs PA_CORE_HOOK_SINK_INPUT_FIXATE

Lennart Poettering lennart at poettering.net
Fri Jun 13 11:17:47 PDT 2008


On Fri, 13.06.08 09:31, Nick Thompson (rextanka at comcast.net) wrote:

> My pulg-in is a little different to the ones provided in that it does  
> not directly create sink-inputs and so I don't call _put myself.

Yes, it's just one that hooks into touting and stuff, so this is very
much OK.

> What I see in the plugin is that my handler for  
> PA_CORE_HOOK_SINK_INPUT_PUT gets called immediately after the file  
> ceases streaming.  Which is not as expected.

Ceases streaming? are you sure? that makes no sense. The call that
triggers the hook is pa_sink_input_put().

Modules implementing a sink input should be doing this:

  si = pa_sink_input_new(...);
  si->pop = ...;
  si->process_rewind = ...;
  pa_sink_input_put(si);

So the code first allocates the sink input, than fills all kind of
fields, and the final _put() call makes it available to the PA core. 

The _new() calls the _NEW and _FIXATE hooks. the _put() calls the _PUT hook.

> Is my plug expected to call _put?  I thought I would monitor the
> sink  

No. _put() is supposed to be called by the same code that calls
pa_sink_input_new() first. i.e. not you.

> using PA_CORE_HOOK_SINK_INPUT_CHANGED, but it seems the only calls  
> there are for notifying the stream is corked/uncorked.

Uh? There is no such hook. You probably mean
PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED? That hook is indeed called
whenever corked/uncorked state changes.

> I'll keep looking at this, but any pointers appreciated.

Hmm, are you aware that _PUT gets the sink input itself as parameter,
while _NEW and _FIXATE get the pa_sink_input_new_data structure?

If you allow me to have a peek on your code I could probably help you
much quicker.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list