pulse: improve name of monitors

This commit is contained in:
Wim Taymans 2020-07-08 16:10:45 +02:00
parent 4de3403c99
commit 6d41e17ca3
3 changed files with 38 additions and 7 deletions

View file

@ -138,6 +138,23 @@ struct global *pa_context_find_global(pa_context *c, uint32_t id)
return NULL;
}
const char *pa_context_find_global_name(pa_context *c, uint32_t id)
{
struct global *g;
const char *name = NULL;
g = pa_context_find_global(c, id & PA_IDX_MASK_DSP);
if (g == NULL)
return "unknown object";
if (g->mask & (PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE)) {
name = pw_properties_get(g->props, PW_KEY_NODE_NAME);
}
if (name == NULL)
name = "unknown";
return name;
}
struct global *pa_context_find_global_by_name(pa_context *c, uint32_t mask, const char *name)
{
struct global *g;