mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
context: wait till nodes are initialized before notify
This commit is contained in:
parent
bfd805a19e
commit
5e2b740ee0
2 changed files with 8 additions and 3 deletions
|
|
@ -588,9 +588,11 @@ static int set_mask(pa_context *c, struct global *g)
|
||||||
g->link_info.dst->parent_id,
|
g->link_info.dst->parent_id,
|
||||||
g->link_info.dst->id);
|
g->link_info.dst->id);
|
||||||
|
|
||||||
if ((f = pa_context_find_global(c, g->link_info.src->parent_id)) != NULL)
|
if ((f = pa_context_find_global(c, g->link_info.src->parent_id)) != NULL &&
|
||||||
|
!f->init)
|
||||||
emit_event(c, f, PA_SUBSCRIPTION_EVENT_CHANGE);
|
emit_event(c, f, PA_SUBSCRIPTION_EVENT_CHANGE);
|
||||||
if ((f = pa_context_find_global(c, g->link_info.dst->parent_id)) != NULL)
|
if ((f = pa_context_find_global(c, g->link_info.dst->parent_id)) != NULL &&
|
||||||
|
!f->init)
|
||||||
emit_event(c, f, PA_SUBSCRIPTION_EVENT_CHANGE);
|
emit_event(c, f, PA_SUBSCRIPTION_EVENT_CHANGE);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1424,7 +1424,7 @@ struct sink_input_data {
|
||||||
|
|
||||||
static void sink_input_callback(struct sink_input_data *d)
|
static void sink_input_callback(struct sink_input_data *d)
|
||||||
{
|
{
|
||||||
struct global *g = d->global, *l, *cl;
|
struct global *g = d->global, *cl;
|
||||||
struct pw_node_info *info = g->info;
|
struct pw_node_info *info = g->info;
|
||||||
const char *name;
|
const char *name;
|
||||||
pa_sink_input_info i;
|
pa_sink_input_info i;
|
||||||
|
|
@ -1455,6 +1455,7 @@ static void sink_input_callback(struct sink_input_data *d)
|
||||||
i.sink = s->device_index;
|
i.sink = s->device_index;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
struct global *l;
|
||||||
l = pa_context_find_linked(d->context, g->id);
|
l = pa_context_find_linked(d->context, g->id);
|
||||||
i.sink = l ? l->id : PA_INVALID_INDEX;
|
i.sink = l ? l->id : PA_INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
@ -1490,6 +1491,8 @@ static void sink_input_callback(struct sink_input_data *d)
|
||||||
i.has_volume = true;
|
i.has_volume = true;
|
||||||
i.volume_writable = true;
|
i.volume_writable = true;
|
||||||
|
|
||||||
|
pw_log_debug("context %p: sink info for %d sink:%d", g->context, i.index, i.sink);
|
||||||
|
|
||||||
d->cb(d->context, &i, 0, d->userdata);
|
d->cb(d->context, &i, 0, d->userdata);
|
||||||
|
|
||||||
pa_proplist_free(i.proplist);
|
pa_proplist_free(i.proplist);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue