maintain a list of sink inputs/source outputs as part of the pa_client object

This commit is contained in:
Lennart Poettering 2009-01-15 18:38:20 +01:00
parent b6deb0cc4c
commit 344c934edb
5 changed files with 27 additions and 2 deletions

View file

@ -283,6 +283,9 @@ pa_sink_input* pa_sink_input_new(
pa_assert_se(pa_idxset_put(core->sink_inputs, pa_sink_input_ref(i), &i->index) == 0);
pa_assert_se(pa_idxset_put(i->sink->inputs, i, NULL) == 0);
if (i->client)
pa_assert_se(pa_idxset_put(i->client->sink_inputs, i, NULL) >= 0);
pa_log_info("Created input %u \"%s\" on %s with sample spec %s and channel map %s",
i->index,
pa_strnull(pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME)),
@ -372,6 +375,9 @@ void pa_sink_input_unlink(pa_sink_input *i) {
if (pa_idxset_remove_by_data(i->sink->inputs, i, NULL))
pa_sink_input_unref(i);
if (i->client)
pa_idxset_remove_by_data(i->client->sink_inputs, i, NULL);
while ((o = pa_idxset_first(i->direct_outputs, NULL))) {
pa_assert(o != p);
pa_source_output_kill(o);