[pulseaudio-discuss] [PATCH 1/2] alsa: add jack detection support

Tanu Kaskinen tanuk at iki.fi
Wed May 25 12:18:34 PDT 2011


Sorry for late reply...

On Fri, 2011-05-20 at 09:14 -0500, Jorge Eduardo Candelaria wrote:
> >> +    if (event->value)
> >> +        pa_hook_fire(&u->core->hooks[PA_CORE_HOOK_JACK_INSERT], &jack);
> >> +    else
> >> +        pa_hook_fire(&u->core->hooks[PA_CORE_HOOK_JACK_REMOVE], &jack);
> > 
> > Firing core hooks directly from modules looks a bit dirty to me.
> 
> I'm actually not very familiar with hooks, however do we need to signal the jack 
> insertion/removal events from jack_report().
> 
> What would be a more clean solution?

Adding just a couple of trivial functions to the core would probably
suffice:

void pa_jack_inserted(pa_core *c, pa_jack_event *e);
void pa_jack_removed(pa_core *c, pa_jack_event *e);

Those functions would do nothing but call pa_hook_fire(), so this is a
purely cosmetic thing...

-- 
Tanu




More information about the pulseaudio-discuss mailing list