Commit 051f7508 authored by Georg Chini's avatar Georg Chini
Browse files

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.
parent f5d3606f
......@@ -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;
......
......@@ -252,6 +252,8 @@ static void source_output_state_change_cb(pa_source_output *o, pa_source_output_
/* Called from main thread */
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();
......@@ -263,6 +265,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->auto_desc && dest) {
const char *k;
pa_proplist *pl;
......
......@@ -446,6 +446,8 @@ static void source_output_kill_cb(pa_source_output *o) {
/* Called from main thread */
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();
......@@ -457,6 +459,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->auto_desc && dest) {
const char *z;
pa_proplist *pl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment