sink-input: change bool save_sink to char *preferred_sink

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

This patch just replaces the save_sink with preferred_sink, and tries
to keep the original logic.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
This commit is contained in:
Hui Wang 2019-01-15 12:12:52 +08:00
parent 26a66d103f
commit fbf8716685
6 changed files with 55 additions and 28 deletions

View file

@ -656,14 +656,14 @@ static void route_sink_input(struct userdata *u, pa_sink_input *si) {
pa_assert(u);
pa_assert(u->do_routing);
/* Don't override user or application routing requests. */
if (si->save_sink || si->sink_requested_by_application)
return;
/* Skip this if it is already in the process of being moved anyway */
if (!si->sink)
return;
/* Don't override user or application routing requests. */
if (pa_safe_streq(si->sink->name, si->preferred_sink) || si->sink_requested_by_application)
return;
auto_filtered_prop = pa_proplist_gets(si->proplist, "module-device-manager.auto_filtered");
if (auto_filtered_prop)
auto_filtered = (pa_parse_boolean(auto_filtered_prop) == 1);