source: move streams to new appeared sources if they prefer these sources

When a new source appears, all streams that have their
preferred_source set to the new source should be moved to the new
source.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
This commit is contained in:
Hui Wang 2019-12-07 11:36:25 +08:00 committed by Tanu Kaskinen
parent c254f8405c
commit 1cea7ab38d
4 changed files with 45 additions and 65 deletions

View file

@ -671,6 +671,8 @@ void pa_source_put(pa_source *s) {
* source, and if we were to call pa_core_update_default_source() before that,
* the default source might change twice, causing unnecessary stream moving. */
pa_core_update_default_source(s->core);
pa_core_move_streams_to_newly_available_preferred_source(s->core, s);
}
/* Called from main context */