core: change configured_default_sink/source type to string

This allows us to restore the default device properly when a
hotpluggable device (e.g. a USB sound card) is set as the default, but
unplugged temporarily. Previously we would forget that the unplugged
device was ever set as the default, because we had to set
configured_default_sink to NULL to avoid having a stale pa_sink pointer,
and also because module-default-device-restore couldn't resolve the name
of a currently-unplugged device to a pa_sink pointer.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89934
This commit is contained in:
Tanu Kaskinen 2017-06-30 00:09:34 +03:00
parent abdd14d5e0
commit a448cc587c
9 changed files with 63 additions and 56 deletions

View file

@ -636,10 +636,7 @@ void pa_source_unlink(pa_source *s) {
pa_namereg_unregister(s->core, s->name);
pa_idxset_remove_by_data(s->core->sources, s, NULL);
if (s == s->core->configured_default_source)
pa_core_set_configured_default_source(s->core, NULL);
else
pa_core_update_default_source(s->core);
pa_core_update_default_source(s->core);
if (s->card)
pa_idxset_remove_by_data(s->card->sources, s, NULL);