dbusiface-device: Save one level of identation by returning early.

This commit is contained in:
Tanu Kaskinen 2009-08-17 16:55:08 +03:00
parent b528715179
commit 70ff96b8ab

View file

@ -1075,11 +1075,6 @@ static void handle_source_get_all(DBusConnection *conn, DBusMessage *msg, void *
static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t idx, void *userdata) {
pa_dbusiface_device *d = userdata;
pa_assert(c);
pa_assert(d);
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_CHANGE) {
DBusMessage *signal = NULL;
const pa_cvolume *new_volume = NULL;
pa_bool_t new_muted = FALSE;
@ -1089,6 +1084,15 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t
pa_proplist *new_proplist = NULL;
unsigned i = 0;
pa_assert(c);
pa_assert(d);
if ((d->type == DEVICE_TYPE_SINK && idx != d->sink->index) || (d->type == DEVICE_TYPE_SOURCE && idx != d->source->index))
return;
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) != PA_SUBSCRIPTION_EVENT_CHANGE)
return;
pa_assert(((d->type == DEVICE_TYPE_SINK)
&& ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK))
|| ((d->type == DEVICE_TYPE_SOURCE)
@ -1196,7 +1200,6 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t
signal = NULL;
}
}
}
pa_dbusiface_device *pa_dbusiface_device_new_sink(pa_dbusiface_core *core, pa_sink *sink) {
pa_dbusiface_device *d = NULL;