diff options
Diffstat (limited to 'src/pulsecore/source-output.c')
-rw-r--r-- | src/pulsecore/source-output.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c index 1d21ffb6..204e06cc 100644 --- a/src/pulsecore/source-output.c +++ b/src/pulsecore/source-output.c @@ -685,15 +685,15 @@ int pa_source_output_start_move(pa_source_output *o) { origin = o->source; - pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_REMOVE_OUTPUT, o, 0, NULL) == 0); + pa_idxset_remove_by_data(o->source->outputs, o, NULL); if (pa_source_output_get_state(o) == PA_SOURCE_OUTPUT_CORKED) pa_assert_se(origin->n_corked-- >= 1); - pa_idxset_remove_by_data(o->source->outputs, o, NULL); - o->source = NULL; + pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_REMOVE_OUTPUT, o, 0, NULL) == 0); - pa_source_update_status(origin); + pa_source_update_status(o->source); + o->source = NULL; return 0; } @@ -707,6 +707,9 @@ int pa_source_output_finish_move(pa_source_output *o, pa_source *dest) { pa_assert(!o->source); pa_source_assert_ref(dest); + if (!pa_source_output_may_move_to(o, dest)) + return -1; + o->source = dest; pa_idxset_put(o->source->outputs, o, NULL); |