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

@ -222,9 +222,6 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
if (so->source == source)
continue;
if (so->save_source)
continue;
if (so->direct_on_input)
continue;
@ -233,6 +230,9 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
if (!so->source)
continue;
if (pa_safe_streq(so->source->name, so->preferred_source))
continue;
/* It might happen that a stream and a source are set up at the
same time, in which case we want to make sure we don't
interfere with that */