virtual sources: Propagate asyncmsgq change after source-output move

Currently, when the master of a virtual source is moved, the change of the
asyncmsgq is not propagated to other attached virtual sources. This leads
to a crash when the original master source is no longer available.

This patch fixes the issue by modifying the moving callback to propagate the
change to attached virtual sources.

Virtual sinks show a similar bug but that will be fixed in a different patch
series.
This commit is contained in:
Georg Chini 2020-01-13 20:40:04 +01:00
parent f5d3606fe7
commit 051f7508b4
3 changed files with 24 additions and 0 deletions

View file

@ -1466,6 +1466,8 @@ static bool sink_input_may_move_to_cb(pa_sink_input *i, pa_sink *dest) {
/* Called from main context. */
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
struct userdata *u;
uint32_t idx;
pa_source_output *output;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
@ -1477,6 +1479,12 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
} else
pa_source_set_asyncmsgq(u->source, NULL);
/* Propagate asyncmsq change to attached virtual sources */
PA_IDXSET_FOREACH(output, u->source->outputs, idx) {
if (output->destination_source && output->moving)
output->moving(output, u->source);
}
if (u->source_auto_desc && dest) {
const char *y, *z;
pa_proplist *pl;