mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-13 13:29:58 -05:00
properly detach/attach when moving sink inputs
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1874 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
f3f44dab37
commit
3b2835d334
1 changed files with 20 additions and 0 deletions
|
|
@ -819,12 +819,20 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
|
|||
if (i->attach)
|
||||
i->attach(i);
|
||||
|
||||
/* If you change anything here, make sure to change the
|
||||
* ghost sink input handling a few lines down at
|
||||
* PA_SINK_MESSAGE_REMOVE_INPUT_AND_BUFFER, too. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
case PA_SINK_MESSAGE_REMOVE_INPUT: {
|
||||
pa_sink_input *i = PA_SINK_INPUT(userdata);
|
||||
|
||||
/* If you change anything here, make sure to change the
|
||||
* sink input handling a few lines down at
|
||||
* PA_SINK_MESSAGE_REMOVE_INPUT_AND_BUFFER, too. */
|
||||
|
||||
if (i->detach)
|
||||
i->detach(i);
|
||||
|
||||
|
|
@ -864,6 +872,12 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
|
|||
pa_assert(!info->sink_input->thread_info.sync_next);
|
||||
pa_assert(!info->sink_input->thread_info.sync_prev);
|
||||
|
||||
if (info->sink_input->detach)
|
||||
info->sink_input->detach(info->sink_input);
|
||||
|
||||
pa_assert(info->sink_input->thread_info.attached);
|
||||
info->sink_input->thread_info.attached = FALSE;
|
||||
|
||||
if (info->ghost_sink_input) {
|
||||
pa_assert(info->buffer_bytes > 0);
|
||||
pa_assert(info->buffer);
|
||||
|
|
@ -915,6 +929,12 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
|
|||
if (info->ghost_sink_input) {
|
||||
pa_hashmap_put(s->thread_info.inputs, PA_UINT32_TO_PTR(info->ghost_sink_input->index), pa_sink_input_ref(info->ghost_sink_input));
|
||||
info->ghost_sink_input->thread_info.sync_prev = info->ghost_sink_input->thread_info.sync_next = NULL;
|
||||
|
||||
pa_assert(!info->ghost_sink_input->thread_info.attached);
|
||||
info->ghost_sink_input->thread_info.attached = TRUE;
|
||||
|
||||
if (info->ghost_sink_input->attach)
|
||||
info->ghost_sink_input->attach(info->ghost_sink_input);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue