Increase ref counter of sink input as long as it is included in the sink idxset

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1542 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-07-26 13:18:50 +00:00
parent d80fd10a67
commit 222a6d270e
2 changed files with 4 additions and 2 deletions

View file

@ -198,7 +198,7 @@ pa_sink_input* pa_sink_input_new(
i->thread_info.volume = i->volume;
i->thread_info.muted = i->muted;
pa_assert_se(pa_idxset_put(core->sink_inputs, i, &i->index) == 0);
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);
pa_log_info("Created input %u \"%s\" on %s with sample spec %s",
@ -235,6 +235,7 @@ void pa_sink_input_disconnect(pa_sink_input *i) {
pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i->sink), PA_SINK_MESSAGE_REMOVE_INPUT, i, NULL);
pa_idxset_remove_by_data(i->sink->core->sink_inputs, i, NULL);
pa_idxset_remove_by_data(i->sink->inputs, i, NULL);
pa_sink_input_unref(i);
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_REMOVE, i->index);