mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
device-manager: Reroute the streams on startup and update our cache on enable.
This commit is contained in:
parent
df893f6d72
commit
d81fa00c0c
1 changed files with 8 additions and 10 deletions
|
|
@ -920,7 +920,11 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
|
||||||
if (pa_tagstruct_get_boolean(t, &enable) < 0)
|
if (pa_tagstruct_get_boolean(t, &enable) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
u->do_routing = enable;
|
if ((u->do_routing = enable)) {
|
||||||
|
/* Update our caches */
|
||||||
|
update_highest_priority_device_indexes(u, "sink:", NULL);
|
||||||
|
update_highest_priority_device_indexes(u, "source:", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1158,15 +1162,9 @@ int pa__init(pa_module*m) {
|
||||||
PA_IDXSET_FOREACH(source, m->core->sources, idx)
|
PA_IDXSET_FOREACH(source, m->core->sources, idx)
|
||||||
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_NEW, source->index, u);
|
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_NEW, source->index, u);
|
||||||
|
|
||||||
/* Update our caches (all available devices will be present in our database now */
|
/* Perform the routing (if it's enabled) which will update our priority list cache too */
|
||||||
update_highest_priority_device_indexes(u, "sink:", NULL);
|
reroute_sinks(u, NULL);
|
||||||
update_highest_priority_device_indexes(u, "source:", NULL);
|
reroute_sources(u, NULL);
|
||||||
|
|
||||||
PA_IDXSET_FOREACH(si, m->core->sink_inputs, idx)
|
|
||||||
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_NEW, si->index, u);
|
|
||||||
|
|
||||||
PA_IDXSET_FOREACH(so, m->core->source_outputs, idx)
|
|
||||||
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_NEW, so->index, u);
|
|
||||||
|
|
||||||
pa_modargs_free(ma);
|
pa_modargs_free(ma);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue