[pulseaudio-discuss] [PATCH v1 1/2] loopback: Cork sink-input if source is suspended

Tanu Kaskinen tanuk at iki.fi
Wed Sep 19 11:05:57 PDT 2012


On Wed, 2012-09-19 at 20:56 +0300, Tanu Kaskinen wrote:
> On Thu, 2012-09-13 at 14:49 +0200, Mikel Astiz wrote:
> > @@ -902,6 +914,9 @@ int pa__init(pa_module *m) {
> >      pa_sink_input_put(u->sink_input);
> >      pa_source_output_put(u->source_output);
> >  
> > +    if (pa_source_get_state(u->source_output->source) == PA_SOURCE_SUSPENDED)
> > +	    pa_sink_input_cork(u->sink_input, TRUE);
> 
> I think the sink input should be created in corked state instead of
> corking it right after it has been started. Probably not a big
> difference in practice, but it would be a bit cleaner... Currently
> there's no good way to do it, though. I think a new flag needs to be
> added: PA_SINK_INPUT_START_CORKED_ON_SUSPEND.

Gah, that wouldn't help... The sink input needs to be corked if the
*source* is suspended, and pa_sink_input_new() doesn't have any idea
about that.

How about inverting the logic: use PA_SINK_INPUT_START_CORKED, and then
if the source is not suspended, uncork the sink input? I think it's
better to have a short period of being needlessly corked than a short
period of being needlessly active.

-- 
Tanu



More information about the pulseaudio-discuss mailing list