summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-07-26 13:18:50 +0000
committerLennart Poettering <lennart@poettering.net>2007-07-26 13:18:50 +0000
commit222a6d270ed49d50d0ab73590d45449a77c17ff2 (patch)
tree1a567cb7fac9ff856e3fd4f01584b3bc18816f09
parentd80fd10a67e2764d301e8ff41cc271c0eee2399f (diff)
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
-rw-r--r--src/pulsecore/sink-input.c3
-rw-r--r--src/pulsecore/source-output.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index db98dd54..96836610 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -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);
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index defb7797..ee76a6e0 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -157,7 +157,7 @@ pa_source_output* pa_source_output_new(
o->thread_info.resampler = resampler;
pa_assert_se(pa_idxset_put(core->source_outputs, o, &o->index) == 0);
- pa_assert_se( pa_idxset_put(o->source->outputs, o, NULL) == 0);
+ pa_assert_se(pa_idxset_put(o->source->outputs, pa_source_output_ref(o), NULL) == 0);
pa_log_info("Created output %u \"%s\" on %s with sample spec %s",
o->index,
@@ -191,6 +191,7 @@ void pa_source_output_disconnect(pa_source_output*o) {
pa_idxset_remove_by_data(o->source->core->source_outputs, o, NULL);
pa_idxset_remove_by_data(o->source->outputs, o, NULL);
+ pa_source_output_unref(o);
pa_subscription_post(o->source->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_REMOVE, o->index);