mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
dbusiface-device: Save one level of identation by returning early.
This commit is contained in:
parent
b528715179
commit
70ff96b8ab
1 changed files with 92 additions and 89 deletions
|
|
@ -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) {
|
static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t idx, void *userdata) {
|
||||||
pa_dbusiface_device *d = 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;
|
DBusMessage *signal = NULL;
|
||||||
const pa_cvolume *new_volume = NULL;
|
const pa_cvolume *new_volume = NULL;
|
||||||
pa_bool_t new_muted = FALSE;
|
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;
|
pa_proplist *new_proplist = NULL;
|
||||||
unsigned i = 0;
|
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)
|
pa_assert(((d->type == DEVICE_TYPE_SINK)
|
||||||
&& ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK))
|
&& ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK))
|
||||||
|| ((d->type == DEVICE_TYPE_SOURCE)
|
|| ((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;
|
signal = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pa_dbusiface_device *pa_dbusiface_device_new_sink(pa_dbusiface_core *core, pa_sink *sink) {
|
pa_dbusiface_device *pa_dbusiface_device_new_sink(pa_dbusiface_core *core, pa_sink *sink) {
|
||||||
pa_dbusiface_device *d = NULL;
|
pa_dbusiface_device *d = NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue