mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
* add new state changed hook for streams
* update sink->n_corked properly when moving streams git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1900 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
ac86fa1b97
commit
f0f9df9990
3 changed files with 18 additions and 0 deletions
|
|
@ -60,6 +60,7 @@ typedef enum pa_core_hook {
|
|||
PA_CORE_HOOK_SINK_INPUT_MOVE,
|
||||
PA_CORE_HOOK_SINK_INPUT_MOVE_POST,
|
||||
PA_CORE_HOOK_SINK_INPUT_NAME_CHANGED,
|
||||
PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED,
|
||||
PA_CORE_HOOK_SOURCE_OUTPUT_NEW,
|
||||
PA_CORE_HOOK_SOURCE_OUTPUT_PUT,
|
||||
PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK,
|
||||
|
|
@ -67,6 +68,7 @@ typedef enum pa_core_hook {
|
|||
PA_CORE_HOOK_SOURCE_OUTPUT_MOVE,
|
||||
PA_CORE_HOOK_SOURCE_OUTPUT_MOVE_POST,
|
||||
PA_CORE_HOOK_SOURCE_OUTPUT_NAME_CHANGED,
|
||||
PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED,
|
||||
PA_CORE_HOOK_MAX
|
||||
} pa_core_hook_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -262,6 +262,9 @@ static int sink_input_set_state(pa_sink_input *i, pa_sink_input_state_t state) {
|
|||
ssync->state = state;
|
||||
}
|
||||
|
||||
if (state != PA_SINK_INPUT_UNLINKED)
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -825,6 +828,11 @@ int pa_sink_input_move_to(pa_sink_input *i, pa_sink *dest, int immediately) {
|
|||
pa_idxset_put(dest->inputs, i, NULL);
|
||||
i->sink = dest;
|
||||
|
||||
if (pa_sink_input_get_state(i) == PA_SINK_INPUT_CORKED) {
|
||||
pa_assert_se(origin->n_corked-- >= 1);
|
||||
dest->n_corked++;
|
||||
}
|
||||
|
||||
/* Replace resampler */
|
||||
if (new_resampler != i->thread_info.resampler) {
|
||||
if (i->thread_info.resampler)
|
||||
|
|
|
|||
|
|
@ -192,6 +192,9 @@ static int source_output_set_state(pa_source_output *o, pa_source_output_state_t
|
|||
|
||||
o->state = state;
|
||||
|
||||
if (state != PA_SOURCE_OUTPUT_UNLINKED)
|
||||
pa_hook_fire(&o->source->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], o);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -427,6 +430,11 @@ int pa_source_output_move_to(pa_source_output *o, pa_source *dest) {
|
|||
pa_idxset_put(dest->outputs, o, NULL);
|
||||
o->source = dest;
|
||||
|
||||
if (pa_source_output_get_state(o) == PA_SOURCE_OUTPUT_CORKED) {
|
||||
pa_assert_se(origin->n_corked-- >= 1);
|
||||
dest->n_corked++;
|
||||
}
|
||||
|
||||
/* Replace resampler */
|
||||
if (new_resampler != o->thread_info.resampler) {
|
||||
if (o->thread_info.resampler)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue