Clean up dwmblocks-pulse-listener.c

This commit is contained in:
Alexander Rosenberg 2023-03-06 12:53:36 -08:00
parent 502f596c87
commit 2e64eee765
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -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) {
case PA_SUBSCRIPTION_EVENT_SINK:
op = pa_context_get_sink_info_by_index(ctx,
idx, idx,
(pa_sink_info_cb_t) sink_info_callback, (pa_sink_info_cb_t) sink_info_callback,
target); target);
break;
}
if (op) {
pa_operation_unref(op); pa_operation_unref(op);
} }
} }