o->muted = data->muted;
- if (data->sync_base) {
- o->sync_next = data->sync_base->sync_next;
- o->sync_prev = data->sync_base;
-
- if (data->sync_base->sync_next)
- data->sync_base->sync_next->sync_prev = o;
- data->sync_base->sync_next = o;
- } else
- o->sync_next = o->sync_prev = NULL;
-
o->direct_on_input = data->direct_on_input;
reset_callbacks(o);
/* Called from main context */
static void source_output_set_state(pa_source_output *o, pa_source_output_state_t state) {
- pa_source_output *ssync;
+
pa_assert(o);
pa_assert_ctl_context();
update_n_corked(o, state);
o->state = state;
- for (ssync = o->sync_prev; ssync; ssync = ssync->sync_prev) {
- update_n_corked(ssync, state);
- ssync->state = state;
- }
- for (ssync = o->sync_next; ssync; ssync = ssync->sync_next) {
- update_n_corked(ssync, state);
- ssync->state = state;
- }
-
if (state != PA_SOURCE_OUTPUT_UNLINKED) {
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], o);
- for (ssync = o->sync_prev; ssync; ssync = ssync->sync_prev)
- pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], ssync);
-
- for (ssync = o->sync_next; ssync; ssync = ssync->sync_next)
- pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], ssync);
-
if (PA_SOURCE_OUTPUT_IS_LINKED(state))
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
}
if (linked)
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], o);
- if (o->sync_prev)
- o->sync_prev->sync_next = o->sync_next;
- if (o->sync_next)
- o->sync_next->sync_prev = o->sync_prev;
-
- o->sync_prev = o->sync_next = NULL;
-
if (o->direct_on_input)
pa_idxset_remove_by_data(o->direct_on_input->direct_outputs, o, NULL);
if (o->direct_on_input)
return FALSE;
- if (o->sync_next || o->sync_prev) {
- pa_log_warn("Moving synchronized streams not supported.");
- return FALSE;
- }
-
return TRUE;
}
pa_resampler_set_output_rate(o->thread_info.resampler, PA_PTR_TO_UINT(userdata));
return 0;
- case PA_SOURCE_OUTPUT_MESSAGE_SET_STATE: {
- pa_source_output *ssync;
+ case PA_SOURCE_OUTPUT_MESSAGE_SET_STATE:
pa_source_output_set_state_within_thread(o, PA_PTR_TO_UINT(userdata));
- for (ssync = o->thread_info.sync_prev; ssync; ssync = ssync->thread_info.sync_prev)
- pa_source_output_set_state_within_thread(ssync, PA_PTR_TO_UINT(userdata));
-
- for (ssync = o->thread_info.sync_next; ssync; ssync = ssync->thread_info.sync_next)
- pa_source_output_set_state_within_thread(ssync, PA_PTR_TO_UINT(userdata));
-
return 0;
- }
case PA_SOURCE_OUTPUT_MESSAGE_SET_REQUESTED_LATENCY: {
pa_usec_t *usec = userdata;
pa_channel_map channel_map;
pa_format_info *format;
- pa_source_output *sync_prev, *sync_next;
-
/* Also see http://pulseaudio.org/wiki/InternalVolumes */
pa_cvolume volume; /* The volume clients are informed about */
pa_cvolume reference_ratio; /* The ratio of the stream's volume to the source's reference volume */
* don't implement rewind() */
pa_memblockq *delay_memblockq;
- pa_source_output *sync_prev, *sync_next;
-
/* The requested latency for the source */
pa_usec_t requested_source_latency;
pa_resample_method_t resample_method;
- pa_source_output *sync_base;
-
pa_sample_spec sample_spec;
pa_channel_map channel_map;
pa_format_info *format;
pa_hashmap_put(s->thread_info.outputs, PA_UINT32_TO_PTR(o->index), pa_source_output_ref(o));
- /* Since the caller sleeps in pa_source_output_put(), we can
- * safely access data outside of thread_info even though
- * it is mutable */
-
- if ((o->thread_info.sync_prev = o->sync_prev)) {
- pa_assert(o->source == o->thread_info.sync_prev->source);
- pa_assert(o->sync_prev->sync_next == o);
- o->thread_info.sync_prev->thread_info.sync_next = o;
- }
-
- if ((o->thread_info.sync_next = o->sync_next)) {
- pa_assert(o->source == o->thread_info.sync_next->source);
- pa_assert(o->sync_next->sync_prev == o);
- o->thread_info.sync_next->thread_info.sync_prev = o;
- }
-
if (o->direct_on_input) {
o->thread_info.direct_on_input = o->direct_on_input;
pa_hashmap_put(o->thread_info.direct_on_input->thread_info.direct_outputs, PA_UINT32_TO_PTR(o->index), o);
pa_assert(o->thread_info.attached);
o->thread_info.attached = FALSE;
- /* Since the caller sleeps in pa_sink_input_unlink(),
- * we can safely access data outside of thread_info even
- * though it is mutable */
-
- pa_assert(!o->sync_prev);
- pa_assert(!o->sync_next);
-
- if (o->thread_info.sync_prev) {
- o->thread_info.sync_prev->thread_info.sync_next = o->thread_info.sync_prev->sync_next;
- o->thread_info.sync_prev = NULL;
- }
-
- if (o->thread_info.sync_next) {
- o->thread_info.sync_next->thread_info.sync_prev = o->thread_info.sync_next->sync_prev;
- o->thread_info.sync_next = NULL;
- }
-
if (o->thread_info.direct_on_input) {
pa_hashmap_remove(o->thread_info.direct_on_input->thread_info.direct_outputs, PA_UINT32_TO_PTR(o->index));
o->thread_info.direct_on_input = NULL;