mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
in most cases we can use i->core instead of i->sink->core and o->coure instead of o->source->core
This commit is contained in:
parent
d5e088ded7
commit
cf24b57279
2 changed files with 32 additions and 32 deletions
|
|
@ -338,13 +338,13 @@ static int sink_input_set_state(pa_sink_input *i, pa_sink_input_state_t state) {
|
|||
}
|
||||
|
||||
if (state != PA_SINK_INPUT_UNLINKED) {
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], i);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], i);
|
||||
|
||||
for (ssync = i->sync_prev; ssync; ssync = ssync->sync_prev)
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], ssync);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], ssync);
|
||||
|
||||
for (ssync = i->sync_next; ssync; ssync = ssync->sync_next)
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], ssync);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED], ssync);
|
||||
}
|
||||
|
||||
pa_sink_update_status(i->sink);
|
||||
|
|
@ -366,7 +366,7 @@ void pa_sink_input_unlink(pa_sink_input *i) {
|
|||
linked = PA_SINK_INPUT_IS_LINKED(i->state);
|
||||
|
||||
if (linked)
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], i);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], i);
|
||||
|
||||
if (i->sync_prev)
|
||||
i->sync_prev->sync_next = i->sync_next;
|
||||
|
|
@ -398,8 +398,8 @@ void pa_sink_input_unlink(pa_sink_input *i) {
|
|||
reset_callbacks(i);
|
||||
|
||||
if (linked) {
|
||||
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_REMOVE, i->index);
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK_POST], i);
|
||||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_REMOVE, i->index);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK_POST], i);
|
||||
}
|
||||
|
||||
pa_sink_update_status(i->sink);
|
||||
|
|
@ -463,8 +463,8 @@ void pa_sink_input_put(pa_sink_input *i) {
|
|||
|
||||
pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i->sink), PA_SINK_MESSAGE_ADD_INPUT, i, 0, NULL) == 0);
|
||||
|
||||
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_NEW, i->index);
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], i);
|
||||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_NEW, i->index);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], i);
|
||||
|
||||
pa_sink_update_status(i->sink);
|
||||
}
|
||||
|
|
@ -519,9 +519,9 @@ int pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, pa
|
|||
|
||||
block_size_max_sink_input = i->thread_info.resampler ?
|
||||
pa_resampler_max_block_size(i->thread_info.resampler) :
|
||||
pa_frame_align(pa_mempool_block_size_max(i->sink->core->mempool), &i->sample_spec);
|
||||
pa_frame_align(pa_mempool_block_size_max(i->core->mempool), &i->sample_spec);
|
||||
|
||||
block_size_max_sink = pa_frame_align(pa_mempool_block_size_max(i->sink->core->mempool), &i->sink->sample_spec);
|
||||
block_size_max_sink = pa_frame_align(pa_mempool_block_size_max(i->core->mempool), &i->sink->sample_spec);
|
||||
|
||||
/* Default buffer size */
|
||||
if (slength <= 0)
|
||||
|
|
@ -836,7 +836,7 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume) {
|
|||
|
||||
if (!pa_cvolume_equal(&i->virtual_volume, &data.virtual_volume)) {
|
||||
i->virtual_volume = data.virtual_volume;
|
||||
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -860,7 +860,7 @@ void pa_sink_input_set_mute(pa_sink_input *i, pa_bool_t mute) {
|
|||
i->muted = mute;
|
||||
|
||||
pa_asyncmsgq_post(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_MUTE, PA_UINT_TO_PTR(mute), 0, NULL, NULL);
|
||||
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
|
|
@ -879,8 +879,8 @@ pa_bool_t pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode,
|
|||
pa_proplist_update(i->proplist, mode, p);
|
||||
|
||||
if (PA_SINK_IS_LINKED(i->state)) {
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED], i);
|
||||
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED], i);
|
||||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -907,7 +907,7 @@ int pa_sink_input_set_rate(pa_sink_input *i, uint32_t rate) {
|
|||
|
||||
pa_asyncmsgq_post(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_RATE, PA_UINT_TO_PTR(rate), 0, NULL, NULL);
|
||||
|
||||
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -930,8 +930,8 @@ void pa_sink_input_set_name(pa_sink_input *i, const char *name) {
|
|||
pa_proplist_unset(i->proplist, PA_PROP_MEDIA_NAME);
|
||||
|
||||
if (PA_SINK_INPUT_IS_LINKED(i->state)) {
|
||||
pa_hook_fire(&i->sink->core->hooks[PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED], i);
|
||||
pa_subscription_post(i->sink->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED], i);
|
||||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1011,7 +1011,7 @@ int pa_sink_input_move_to(pa_sink_input *i, pa_sink *dest) {
|
|||
/* Okey, we need a new resampler for the new sink */
|
||||
|
||||
if (!(new_resampler = pa_resampler_new(
|
||||
dest->core->mempool,
|
||||
i->core->mempool,
|
||||
&i->sample_spec, &i->channel_map,
|
||||
&dest->sample_spec, &dest->channel_map,
|
||||
i->resample_method,
|
||||
|
|
@ -1292,8 +1292,8 @@ pa_memchunk* pa_sink_input_get_silence(pa_sink_input *i, pa_memchunk *ret) {
|
|||
pa_assert(ret);
|
||||
|
||||
pa_silence_memchunk_get(
|
||||
&i->sink->core->silence_cache,
|
||||
i->sink->core->mempool,
|
||||
&i->core->silence_cache,
|
||||
i->core->mempool,
|
||||
ret,
|
||||
&i->sample_spec,
|
||||
i->thread_info.resampler ? pa_resampler_max_block_size(i->thread_info.resampler) : 0);
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ 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);
|
||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], o);
|
||||
|
||||
pa_source_update_status(o->source);
|
||||
|
||||
|
|
@ -289,7 +289,7 @@ void pa_source_output_unlink(pa_source_output*o) {
|
|||
linked = PA_SOURCE_OUTPUT_IS_LINKED(o->state);
|
||||
|
||||
if (linked)
|
||||
pa_hook_fire(&o->source->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], o);
|
||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], o);
|
||||
|
||||
if (o->direct_on_input)
|
||||
pa_idxset_remove_by_data(o->direct_on_input->direct_outputs, o, NULL);
|
||||
|
|
@ -310,8 +310,8 @@ void pa_source_output_unlink(pa_source_output*o) {
|
|||
reset_callbacks(o);
|
||||
|
||||
if (linked) {
|
||||
pa_subscription_post(o->source->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_REMOVE, o->index);
|
||||
pa_hook_fire(&o->source->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK_POST], o);
|
||||
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_REMOVE, o->index);
|
||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK_POST], o);
|
||||
}
|
||||
|
||||
pa_source_update_status(o->source);
|
||||
|
|
@ -365,8 +365,8 @@ void pa_source_output_put(pa_source_output *o) {
|
|||
|
||||
pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_ADD_OUTPUT, o, 0, NULL) == 0);
|
||||
|
||||
pa_subscription_post(o->source->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_NEW, o->index);
|
||||
pa_hook_fire(&o->source->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PUT], o);
|
||||
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_NEW, o->index);
|
||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PUT], o);
|
||||
|
||||
pa_source_update_status(o->source);
|
||||
}
|
||||
|
|
@ -574,7 +574,7 @@ int pa_source_output_set_rate(pa_source_output *o, uint32_t rate) {
|
|||
|
||||
pa_asyncmsgq_post(o->source->asyncmsgq, PA_MSGOBJECT(o), PA_SOURCE_OUTPUT_MESSAGE_SET_RATE, PA_UINT_TO_PTR(rate), 0, NULL, NULL);
|
||||
|
||||
pa_subscription_post(o->source->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -597,8 +597,8 @@ void pa_source_output_set_name(pa_source_output *o, const char *name) {
|
|||
pa_proplist_unset(o->proplist, PA_PROP_MEDIA_NAME);
|
||||
|
||||
if (PA_SOURCE_OUTPUT_IS_LINKED(o->state)) {
|
||||
pa_hook_fire(&o->source->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PROPLIST_CHANGED], o);
|
||||
pa_subscription_post(o->source->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PROPLIST_CHANGED], o);
|
||||
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -610,8 +610,8 @@ pa_bool_t pa_source_output_update_proplist(pa_source_output *o, pa_update_mode_t
|
|||
pa_proplist_update(o->proplist, mode, p);
|
||||
|
||||
if (PA_SINK_IS_LINKED(o->state)) {
|
||||
pa_hook_fire(&o->source->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PROPLIST_CHANGED], o);
|
||||
pa_subscription_post(o->source->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PROPLIST_CHANGED], o);
|
||||
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -682,7 +682,7 @@ int pa_source_output_move_to(pa_source_output *o, pa_source *dest) {
|
|||
/* Okey, we need a new resampler for the new source */
|
||||
|
||||
if (!(new_resampler = pa_resampler_new(
|
||||
dest->core->mempool,
|
||||
o->core->mempool,
|
||||
&dest->sample_spec, &dest->channel_map,
|
||||
&o->sample_spec, &o->channel_map,
|
||||
o->resample_method,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue