mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
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:
parent
f5d3606fe7
commit
051f7508b4
3 changed files with 24 additions and 0 deletions
|
|
@ -1466,6 +1466,8 @@ static bool sink_input_may_move_to_cb(pa_sink_input *i, pa_sink *dest) {
|
||||||
/* Called from main context. */
|
/* Called from main context. */
|
||||||
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
||||||
struct userdata *u;
|
struct userdata *u;
|
||||||
|
uint32_t idx;
|
||||||
|
pa_source_output *output;
|
||||||
|
|
||||||
pa_source_output_assert_ref(o);
|
pa_source_output_assert_ref(o);
|
||||||
pa_assert_ctl_context();
|
pa_assert_ctl_context();
|
||||||
|
|
@ -1477,6 +1479,12 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
||||||
} else
|
} else
|
||||||
pa_source_set_asyncmsgq(u->source, NULL);
|
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) {
|
if (u->source_auto_desc && dest) {
|
||||||
const char *y, *z;
|
const char *y, *z;
|
||||||
pa_proplist *pl;
|
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 */
|
/* Called from main thread */
|
||||||
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
||||||
struct userdata *u;
|
struct userdata *u;
|
||||||
|
uint32_t idx;
|
||||||
|
pa_source_output *output;
|
||||||
|
|
||||||
pa_source_output_assert_ref(o);
|
pa_source_output_assert_ref(o);
|
||||||
pa_assert_ctl_context();
|
pa_assert_ctl_context();
|
||||||
|
|
@ -263,6 +265,12 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
||||||
} else
|
} else
|
||||||
pa_source_set_asyncmsgq(u->source, NULL);
|
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) {
|
if (u->auto_desc && dest) {
|
||||||
const char *k;
|
const char *k;
|
||||||
pa_proplist *pl;
|
pa_proplist *pl;
|
||||||
|
|
|
||||||
|
|
@ -446,6 +446,8 @@ static void source_output_kill_cb(pa_source_output *o) {
|
||||||
/* Called from main thread */
|
/* Called from main thread */
|
||||||
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
||||||
struct userdata *u;
|
struct userdata *u;
|
||||||
|
uint32_t idx;
|
||||||
|
pa_source_output *output;
|
||||||
|
|
||||||
pa_source_output_assert_ref(o);
|
pa_source_output_assert_ref(o);
|
||||||
pa_assert_ctl_context();
|
pa_assert_ctl_context();
|
||||||
|
|
@ -457,6 +459,12 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
||||||
} else
|
} else
|
||||||
pa_source_set_asyncmsgq(u->source, NULL);
|
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) {
|
if (u->auto_desc && dest) {
|
||||||
const char *z;
|
const char *z;
|
||||||
pa_proplist *pl;
|
pa_proplist *pl;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue