sink-input: clear the preferred_sink if it is default_sink

When the user moves a stream to the current default sink, the
preferred_sink should be set to NULL and module-stream-restore
should clear the routing for that stream in the stream database. From
that point on the stream will be always routed to the default sink.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
This commit is contained in:
Hui Wang 2019-01-16 09:07:26 +08:00
parent 24d5d180b8
commit bc0e728320
2 changed files with 15 additions and 8 deletions

View file

@ -1930,8 +1930,12 @@ int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, bool save) {
save the preferred_sink */
if (save) {
pa_xfree(i->preferred_sink);
i->preferred_sink = pa_xstrdup(dest->name);
if (dest == dest->core->default_sink)
i->preferred_sink = NULL;
else
i->preferred_sink = pa_xstrdup(dest->name);
}
pa_idxset_put(dest->inputs, pa_sink_input_ref(i), NULL);
PA_HASHMAP_FOREACH(v, i->volume_factor_sink_items, state)