[pulseaudio-discuss] sink input unlink hooks

Lennart Poettering lennart at poettering.net
Sun Jan 18 07:23:41 PST 2009


On Thu, 15.01.09 17:47, pl bossart (bossart.nospam at gmail.com) wrote:

> Hi all,
> I am trying to write a module that keeps track of all connections to a sink.
> I started from the code in module-stream-restore.c, read detailed
> explanations from Lennart and the hooks work well. Except for the unlink
> hook. Somehow looking at the client name with the proplist causes a seg
> fault. And when I look at the code in module-stream-restore, I see hooks
> into the native protocol being used, along with subscriptions that
> supposedly are a thing of the past. So my question is, in which cases should
> these be used, and when are hooks into the core sufficient?
> Thanks for your feedback

m-s-r defines an "extension" for the native protocol which allows
clients to query and manipulate the stored stream database as well as
being notified about database changes. For the latter we need to keep
track of native connections, that's why we hook into the native
protocol. Unless you too want to define a protocol extension you don't
need to hook into the native protocol at all.

If you hook into PA_CORE_HOOK_SINK_INPUT_UNLINK you get the still
completely valid pa_sink_input* object as second argument. It's
proplist should still be fully valid as well.

Please note that there is no guarantee that any of the defined
properties is actually set in a sink input's proplist.

If you allow me to have a peek at your code I might be able to tell
you what is wrong.

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