Clean up dwmblocks-pulse-listener.c
This commit is contained in:
parent
502f596c87
commit
2e64eee765
@ -41,17 +41,11 @@ static void server_info_callback(pa_context *ctx, const pa_server_info *info,
|
|||||||
static void subscribe_callback(pa_context *ctx,
|
static void subscribe_callback(pa_context *ctx,
|
||||||
pa_subscription_event_type_t type, uint32_t idx,
|
pa_subscription_event_type_t type, uint32_t idx,
|
||||||
TargetData *target) {
|
TargetData *target) {
|
||||||
unsigned int facility = type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK;
|
if ((type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK) {
|
||||||
pa_operation *op = NULL;
|
pa_operation *op = pa_context_get_sink_info_by_index(ctx,
|
||||||
switch (facility) {
|
idx,
|
||||||
case PA_SUBSCRIPTION_EVENT_SINK:
|
(pa_sink_info_cb_t) sink_info_callback,
|
||||||
op = pa_context_get_sink_info_by_index(ctx,
|
target);
|
||||||
idx,
|
|
||||||
(pa_sink_info_cb_t) sink_info_callback,
|
|
||||||
target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (op) {
|
|
||||||
pa_operation_unref(op);
|
pa_operation_unref(op);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user