This removes the nasty side-effect that a call to
pa_namereg_get_default_{source,sink}() will also *set* the default
source/sink.
This is a more complete fix for commit
766dbc68 ("conf: Make sure
module-dbus-protocol is loaded after module-default-device-restore")
https://bugs.freedesktop.org/show_bug.cgi?id=40897
if (!best || s->priority > best->priority)
best = s;
- if (best)
- return pa_namereg_set_default_sink(c, best);
-
- return NULL;
+ return best;
}
pa_source *pa_namereg_get_default_source(pa_core *c) {
best = s;
if (best)
- return pa_namereg_set_default_source(c, best);
+ return best;
/* Then, fallback to a monitor */
PA_IDXSET_FOREACH(s, c->sources, idx)
s->monitor_of->priority > best->monitor_of->priority))
best = s;
- if (best)
- return pa_namereg_set_default_source(c, best);
-
- return NULL;
+ return best;
}