source-output: change bool save_source to char *preferred_source

The finial objective is to store the preferred source name in the
source-output struct, and use module-stream-restore to save and
restore it.

This patch just replaces the save_source with preferred_source, and
tries to keep the original logic.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
This commit is contained in:
Hui Wang 2019-12-06 21:51:10 +08:00 committed by Tanu Kaskinen
parent 734a00c849
commit 5eec504d68
6 changed files with 54 additions and 29 deletions

View file

@ -184,7 +184,7 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
}
PA_IDXSET_FOREACH(o, old_default_source->outputs, idx) {
if (o->save_source || !PA_SOURCE_OUTPUT_IS_LINKED(o->state))
if (pa_safe_streq(o->source->name, o->preferred_source) || !PA_SOURCE_OUTPUT_IS_LINKED(o->state))
continue;
if (pa_source_output_move_to(o, source, false) < 0)