From ddc69fccb5eec6ed546b1d2fe1771c383eeb5413 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 3 Aug 2006 22:29:55 +0000 Subject: - don't call pa_sink_notify in pa_sink_input_new() because the virtual methods are not yet initialized at this time - some minor cleanups git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1180 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/sink-input.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/pulsecore/sink-input.c') diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 8280d0bf..b89210f4 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -135,8 +135,10 @@ pa_sink_input* pa_sink_input_new( pa_log_info(__FILE__": created %u \"%s\" on %u with sample spec \"%s\"", i->index, i->name, s->index, st); pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_NEW, i->index); - pa_sink_notify(i->sink); + /* We do not call pa_sink_notify() here, because the virtual + * functions have not yet been initialized */ + return i; } @@ -446,7 +448,7 @@ pa_resample_method_t pa_sink_input_get_resample_method(pa_sink_input *i) { assert(i->ref >= 1); if (!i->resampler) - return PA_RESAMPLER_INVALID; + return i->resample_method; return pa_resampler_get_method(i->resampler); } @@ -574,9 +576,9 @@ int pa_sink_input_move_to(pa_sink_input *i, pa_sink *dest, int immediately) { } /* Okey, let's move it */ - pa_idxset_remove_by_data(i->sink->inputs, i, NULL); + pa_idxset_remove_by_data(origin->inputs, i, NULL); + pa_idxset_put(dest->inputs, i, NULL); i->sink = dest; - pa_idxset_put(i->sink->inputs, i, NULL); /* Replace resampler */ if (new_resampler != i->resampler) { -- cgit