mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
sink, source: remove the state getters
pa_sink_get_state() and pa_source_get_state() just return the state variable. We can as well access the state variable directly. There are no behaviour changes, except that module-virtual-source accessed the main thread's sink state variable from its push() callback. I fixed the module so that it uses the thread_info.state variable instead. Also, the compiler started to complain about comparing a sink state variable to a source state enum value in protocol-esound.c. The underlying bug was that a source pointer was assigned to a variable whose type was a sink pointer (somehow using the pa_source_get_state() macro confused the compiler enough so that it didn't complain before). I fixed the variable type.
This commit is contained in:
parent
b4a36453da
commit
6665b466d2
26 changed files with 82 additions and 87 deletions
|
|
@ -1256,7 +1256,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *s, pa_sink_state_t new_stat
|
|||
&& !(new_suspend_cause & PA_SUSPEND_SESSION))
|
||||
sync_mixer(u, s->active_port);
|
||||
|
||||
old_state = pa_sink_get_state(u->sink);
|
||||
old_state = u->sink->state;
|
||||
|
||||
if (PA_SINK_IS_OPENED(old_state) && new_state == PA_SINK_SUSPENDED)
|
||||
reserve_done(u);
|
||||
|
|
|
|||
|
|
@ -1111,7 +1111,7 @@ static int source_set_state_in_main_thread_cb(pa_source *s, pa_source_state_t ne
|
|||
&& !(new_suspend_cause & PA_SUSPEND_SESSION))
|
||||
sync_mixer(u, s->active_port);
|
||||
|
||||
old_state = pa_source_get_state(u->source);
|
||||
old_state = u->source->state;
|
||||
|
||||
if (PA_SOURCE_IS_OPENED(old_state) && new_state == PA_SOURCE_SUSPENDED)
|
||||
reserve_done(u);
|
||||
|
|
|
|||
|
|
@ -849,7 +849,7 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat
|
|||
latency = pa_sink_get_latency(d->sink);
|
||||
is_hardware_device = !!(d->sink->flags & PA_SINK_HARDWARE);
|
||||
is_network_device = !!(d->sink->flags & PA_SINK_NETWORK);
|
||||
state = pa_sink_get_state(d->sink);
|
||||
state = d->sink->state;
|
||||
} else {
|
||||
idx = d->source->index;
|
||||
name = d->source->name;
|
||||
|
|
@ -870,7 +870,7 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat
|
|||
latency = pa_source_get_latency(d->source);
|
||||
is_hardware_device = !!(d->source->flags & PA_SOURCE_HARDWARE);
|
||||
is_network_device = !!(d->source->flags & PA_SOURCE_NETWORK);
|
||||
state = pa_source_get_state(d->source);
|
||||
state = d->source->state;
|
||||
}
|
||||
if (owner_module)
|
||||
owner_module_path = pa_dbusiface_core_get_module_path(d->core, owner_module);
|
||||
|
|
@ -1158,9 +1158,9 @@ static pa_hook_result_t state_changed_cb(void *hook_data, void *call_data, void
|
|||
return PA_HOOK_OK;
|
||||
|
||||
if (d->type == PA_DEVICE_TYPE_SINK)
|
||||
new_sink_state = pa_sink_get_state(d->sink);
|
||||
new_sink_state = d->sink->state;
|
||||
else
|
||||
new_source_state = pa_source_get_state(d->source);
|
||||
new_source_state = d->source->state;
|
||||
|
||||
if ((d->type == PA_DEVICE_TYPE_SINK && d->sink_state != new_sink_state)
|
||||
|| (d->type == PA_DEVICE_TYPE_SOURCE && d->source_state != new_source_state)) {
|
||||
|
|
@ -1258,7 +1258,7 @@ pa_dbusiface_device *pa_dbusiface_device_new_sink(pa_dbusiface_core *core, pa_si
|
|||
d->path = pa_sprintf_malloc("%s/%s%u", PA_DBUS_CORE_OBJECT_PATH, SINK_OBJECT_NAME, sink->index);
|
||||
d->volume = *pa_sink_get_volume(sink, false);
|
||||
d->mute = pa_sink_get_mute(sink, false);
|
||||
d->sink_state = pa_sink_get_state(sink);
|
||||
d->sink_state = sink->state;
|
||||
d->ports = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, (pa_free_cb_t) pa_dbusiface_device_port_free);
|
||||
d->next_port_index = 0;
|
||||
d->active_port = sink->active_port;
|
||||
|
|
@ -1301,7 +1301,7 @@ pa_dbusiface_device *pa_dbusiface_device_new_source(pa_dbusiface_core *core, pa_
|
|||
d->path = pa_sprintf_malloc("%s/%s%u", PA_DBUS_CORE_OBJECT_PATH, SOURCE_OBJECT_NAME, source->index);
|
||||
d->volume = *pa_source_get_volume(source, false);
|
||||
d->mute = pa_source_get_mute(source, false);
|
||||
d->source_state = pa_source_get_state(source);
|
||||
d->source_state = source->state;
|
||||
d->ports = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, (pa_free_cb_t) pa_dbusiface_device_port_free);
|
||||
d->next_port_index = 0;
|
||||
d->active_port = source->active_port;
|
||||
|
|
|
|||
|
|
@ -146,8 +146,8 @@ static const pa_echo_canceller ec_table[] = {
|
|||
#define MAX_LATENCY_BLOCKS 10
|
||||
|
||||
/* Can only be used in main context */
|
||||
#define IS_ACTIVE(u) ((pa_source_get_state((u)->source) == PA_SOURCE_RUNNING) && \
|
||||
(pa_sink_get_state((u)->sink) == PA_SINK_RUNNING))
|
||||
#define IS_ACTIVE(u) (((u)->source->state == PA_SOURCE_RUNNING) && \
|
||||
((u)->sink->state == PA_SINK_RUNNING))
|
||||
|
||||
/* This module creates a new (virtual) source and sink.
|
||||
*
|
||||
|
|
@ -476,7 +476,7 @@ static int source_set_state_in_main_thread_cb(pa_source *s, pa_source_state_t st
|
|||
|
||||
if (state == PA_SOURCE_RUNNING) {
|
||||
/* restart timer when both sink and source are active */
|
||||
if ((pa_sink_get_state(u->sink) == PA_SINK_RUNNING) && u->adjust_time)
|
||||
if ((u->sink->state == PA_SINK_RUNNING) && u->adjust_time)
|
||||
pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + u->adjust_time);
|
||||
|
||||
pa_atomic_store(&u->request_resync, 1);
|
||||
|
|
@ -501,7 +501,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *s, pa_sink_state_t state, p
|
|||
|
||||
if (state == PA_SINK_RUNNING) {
|
||||
/* restart timer when both sink and source are active */
|
||||
if ((pa_source_get_state(u->source) == PA_SOURCE_RUNNING) && u->adjust_time)
|
||||
if ((u->source->state == PA_SOURCE_RUNNING) && u->adjust_time)
|
||||
pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + u->adjust_time);
|
||||
|
||||
pa_atomic_store(&u->request_resync, 1);
|
||||
|
|
@ -597,7 +597,7 @@ static void source_set_volume_cb(pa_source *s) {
|
|||
pa_source_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
if (!PA_SOURCE_IS_LINKED(s->state) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
|
|
@ -611,7 +611,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
@ -626,7 +626,7 @@ static void source_get_volume_cb(pa_source *s) {
|
|||
pa_source_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
if (!PA_SOURCE_IS_LINKED(s->state) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
|
|
@ -647,7 +647,7 @@ static void source_set_mute_cb(pa_source *s) {
|
|||
pa_source_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
if (!PA_SOURCE_IS_LINKED(s->state) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
|
|
@ -661,7 +661,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -194,13 +194,13 @@ static void adjust_rates(struct userdata *u) {
|
|||
if (pa_idxset_size(u->outputs) <= 0)
|
||||
return;
|
||||
|
||||
if (!PA_SINK_IS_OPENED(pa_sink_get_state(u->sink)))
|
||||
if (!PA_SINK_IS_OPENED(u->sink->state))
|
||||
return;
|
||||
|
||||
PA_IDXSET_FOREACH(o, u->outputs, idx) {
|
||||
pa_usec_t sink_latency;
|
||||
|
||||
if (!o->sink_input || !PA_SINK_IS_OPENED(pa_sink_get_state(o->sink)))
|
||||
if (!o->sink_input || !PA_SINK_IS_OPENED(o->sink->state))
|
||||
continue;
|
||||
|
||||
o->total_latency = pa_sink_input_get_latency(o->sink_input, &sink_latency);
|
||||
|
|
@ -237,7 +237,7 @@ static void adjust_rates(struct userdata *u) {
|
|||
uint32_t new_rate = base_rate;
|
||||
uint32_t current_rate;
|
||||
|
||||
if (!o->sink_input || !PA_SINK_IS_OPENED(pa_sink_get_state(o->sink)))
|
||||
if (!o->sink_input || !PA_SINK_IS_OPENED(o->sink->state))
|
||||
continue;
|
||||
|
||||
current_rate = o->sink_input->sample_spec.rate;
|
||||
|
|
@ -273,7 +273,7 @@ static void time_callback(pa_mainloop_api *a, pa_time_event *e, const struct tim
|
|||
|
||||
adjust_rates(u);
|
||||
|
||||
if (pa_sink_get_state(u->sink) == PA_SINK_SUSPENDED) {
|
||||
if (u->sink->state == PA_SINK_SUSPENDED) {
|
||||
u->core->mainloop->time_free(e);
|
||||
u->time_event = NULL;
|
||||
} else
|
||||
|
|
@ -697,7 +697,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *sink, pa_sink_state_t state
|
|||
|
||||
switch (state) {
|
||||
case PA_SINK_SUSPENDED:
|
||||
pa_assert(PA_SINK_IS_OPENED(pa_sink_get_state(u->sink)));
|
||||
pa_assert(PA_SINK_IS_OPENED(u->sink->state));
|
||||
|
||||
suspend(u);
|
||||
break;
|
||||
|
|
@ -705,7 +705,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *sink, pa_sink_state_t state
|
|||
case PA_SINK_IDLE:
|
||||
case PA_SINK_RUNNING:
|
||||
|
||||
if (pa_sink_get_state(u->sink) == PA_SINK_SUSPENDED)
|
||||
if (u->sink->state == PA_SINK_SUSPENDED)
|
||||
unsuspend(u);
|
||||
|
||||
break;
|
||||
|
|
@ -1126,7 +1126,7 @@ static void output_enable(struct output *o) {
|
|||
|
||||
if (output_create_sink_input(o) >= 0) {
|
||||
|
||||
if (pa_sink_get_state(o->sink) != PA_SINK_INIT) {
|
||||
if (o->sink->state != PA_SINK_INIT) {
|
||||
/* Enable the sink input. That means that the sink
|
||||
* is now asked for new data. */
|
||||
pa_sink_input_put(o->sink_input);
|
||||
|
|
@ -1162,7 +1162,7 @@ static void output_disable(struct output *o) {
|
|||
static void output_verify(struct output *o) {
|
||||
pa_assert(o);
|
||||
|
||||
if (PA_SINK_IS_OPENED(pa_sink_get_state(o->userdata->sink)))
|
||||
if (PA_SINK_IS_OPENED(o->userdata->sink->state))
|
||||
output_enable(o);
|
||||
else
|
||||
output_disable(o);
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_n
|
|||
if (s == c->default_sink)
|
||||
continue;
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)))
|
||||
if (!PA_SINK_IS_LINKED(s->state))
|
||||
continue;
|
||||
|
||||
if (role_match(s->proplist, role) && pa_sink_input_new_data_set_sink(new_data, s, false, false))
|
||||
|
|
@ -147,7 +147,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
|
|||
if (s == c->default_source)
|
||||
continue;
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)))
|
||||
if (!PA_SOURCE_IS_LINKED(s->state))
|
||||
continue;
|
||||
|
||||
/* @todo: favour the highest priority device, not the first one we find? */
|
||||
|
|
@ -293,7 +293,7 @@ static pa_hook_result_t sink_unlink_hook_callback(pa_core *c, pa_sink *sink, str
|
|||
if (d == c->default_sink || d == sink)
|
||||
continue;
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(d)))
|
||||
if (!PA_SINK_IS_LINKED(d->state))
|
||||
continue;
|
||||
|
||||
if (role_match(d->proplist, role))
|
||||
|
|
@ -349,7 +349,7 @@ static pa_hook_result_t source_unlink_hook_callback(pa_core *c, pa_source *sourc
|
|||
if (d == c->default_source || d == source)
|
||||
continue;
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(d)))
|
||||
if (!PA_SOURCE_IS_LINKED(d->state))
|
||||
continue;
|
||||
|
||||
/* If moving from a monitor, move to another monitor */
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -714,7 +714,7 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
|
|||
|
||||
/* Uncork the sink input unless the destination is suspended for other
|
||||
* reasons than idle. */
|
||||
if (pa_source_get_state(dest) == PA_SOURCE_SUSPENDED)
|
||||
if (dest->state == PA_SOURCE_SUSPENDED)
|
||||
pa_sink_input_cork(u->sink_input, (dest->suspend_cause != PA_SUSPEND_IDLE));
|
||||
else
|
||||
pa_sink_input_cork(u->sink_input, false);
|
||||
|
|
@ -1098,7 +1098,7 @@ static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
|
|||
|
||||
/* Uncork the source output unless the destination is suspended for other
|
||||
* reasons than idle */
|
||||
if (pa_sink_get_state(dest) == PA_SINK_SUSPENDED)
|
||||
if (dest->state == PA_SINK_SUSPENDED)
|
||||
pa_source_output_cork(u->source_output, (dest->suspend_cause != PA_SUSPEND_IDLE));
|
||||
else
|
||||
pa_source_output_cork(u->source_output, false);
|
||||
|
|
@ -1565,10 +1565,10 @@ int pa__init(pa_module *m) {
|
|||
pa_sink_input_put(u->sink_input);
|
||||
pa_source_output_put(u->source_output);
|
||||
|
||||
if (pa_source_get_state(u->source_output->source) != PA_SOURCE_SUSPENDED)
|
||||
if (u->source_output->source->state != PA_SOURCE_SUSPENDED)
|
||||
pa_sink_input_cork(u->sink_input, false);
|
||||
|
||||
if (pa_sink_get_state(u->sink_input->sink) != PA_SINK_SUSPENDED)
|
||||
if (u->sink_input->sink->state != PA_SINK_SUSPENDED)
|
||||
pa_source_output_cork(u->source_output, false);
|
||||
|
||||
update_adjust_timer(u);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static pa_sink* find_evacuation_sink(pa_core *c, pa_sink_input *i, pa_sink *skip
|
|||
if (target == skip)
|
||||
continue;
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(target)))
|
||||
if (!PA_SINK_IS_LINKED(target->state))
|
||||
continue;
|
||||
|
||||
if (!pa_sink_input_may_move_to(i, target))
|
||||
|
|
@ -224,7 +224,7 @@ static pa_source* find_evacuation_source(pa_core *c, pa_source_output *o, pa_sou
|
|||
if (skip && !target->monitor_of != !skip->monitor_of)
|
||||
continue;
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(target)))
|
||||
if (!PA_SOURCE_IS_LINKED(target->state))
|
||||
continue;
|
||||
|
||||
if (!pa_source_output_may_move_to(o, target))
|
||||
|
|
|
|||
|
|
@ -1453,7 +1453,7 @@ static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_n
|
|||
/* It might happen that a stream and a sink are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (s && PA_SINK_IS_LINKED(pa_sink_get_state(s)))
|
||||
if (s && PA_SINK_IS_LINKED(s->state))
|
||||
if (pa_sink_input_new_data_set_sink(new_data, s, true, false))
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
|
||||
|
|
@ -1556,7 +1556,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
|
|||
/* It might happen that a stream and a sink are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (s && PA_SOURCE_IS_LINKED(pa_source_get_state(s))) {
|
||||
if (s && PA_SOURCE_IS_LINKED(s->state)) {
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
pa_source_output_new_data_set_source(new_data, s, true, false);
|
||||
}
|
||||
|
|
@ -1764,7 +1764,7 @@ static pa_hook_result_t sink_unlink_hook_callback(pa_core *c, pa_sink *sink, str
|
|||
|
||||
if ((d = pa_namereg_get(c, e->device, PA_NAMEREG_SINK)) &&
|
||||
d != sink &&
|
||||
PA_SINK_IS_LINKED(pa_sink_get_state(d)))
|
||||
PA_SINK_IS_LINKED(d->state))
|
||||
pa_sink_input_move_to(si, d, true);
|
||||
}
|
||||
|
||||
|
|
@ -1815,7 +1815,7 @@ static pa_hook_result_t source_unlink_hook_callback(pa_core *c, pa_source *sourc
|
|||
|
||||
if ((d = pa_namereg_get(c, e->device, PA_NAMEREG_SOURCE)) &&
|
||||
d != source &&
|
||||
PA_SOURCE_IS_LINKED(pa_source_get_state(d)))
|
||||
PA_SOURCE_IS_LINKED(d->state))
|
||||
pa_source_output_move_to(so, d, true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -390,18 +390,16 @@ static pa_hook_result_t device_state_changed_hook_cb(pa_core *c, pa_object *o, s
|
|||
|
||||
if (pa_sink_isinstance(o)) {
|
||||
pa_sink *s = PA_SINK(o);
|
||||
pa_sink_state_t state = pa_sink_get_state(s);
|
||||
|
||||
if (pa_sink_check_suspend(s, NULL, NULL) <= 0)
|
||||
if (PA_SINK_IS_OPENED(state))
|
||||
if (PA_SINK_IS_OPENED(s->state))
|
||||
restart(d);
|
||||
|
||||
} else if (pa_source_isinstance(o)) {
|
||||
pa_source *s = PA_SOURCE(o);
|
||||
pa_source_state_t state = pa_source_get_state(s);
|
||||
|
||||
if (pa_source_check_suspend(s, NULL) <= 0)
|
||||
if (PA_SOURCE_IS_OPENED(state))
|
||||
if (PA_SOURCE_IS_OPENED(s->state))
|
||||
restart(d);
|
||||
}
|
||||
|
||||
|
|
@ -481,12 +479,12 @@ void pa__done(pa_module*m) {
|
|||
u = m->userdata;
|
||||
|
||||
PA_HASHMAP_FOREACH(d, u->device_infos, state) {
|
||||
if (d->sink && pa_sink_get_state(d->sink) == PA_SINK_SUSPENDED) {
|
||||
if (d->sink && d->sink->state == PA_SINK_SUSPENDED) {
|
||||
pa_log_debug("Resuming sink %s on module unload.", d->sink->name);
|
||||
pa_sink_suspend(d->sink, false, PA_SUSPEND_IDLE);
|
||||
}
|
||||
|
||||
if (d->source && pa_source_get_state(d->source) == PA_SOURCE_SUSPENDED) {
|
||||
if (d->source && d->source->state == PA_SOURCE_SUSPENDED) {
|
||||
pa_log_debug("Resuming source %s on module unload.", d->source->name);
|
||||
pa_source_suspend(d->source, false, PA_SUSPEND_IDLE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1669,7 +1669,7 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
pa_tagstruct_putu32(reply, PA_INVALID_INDEX);
|
||||
pa_tagstruct_puts(reply, u->sink_name);
|
||||
pa_tagstruct_putu32(reply, u->maxlength);
|
||||
pa_tagstruct_put_boolean(reply, !PA_SINK_IS_OPENED(pa_sink_get_state(u->sink)));
|
||||
pa_tagstruct_put_boolean(reply, !PA_SINK_IS_OPENED(u->sink->state));
|
||||
pa_tagstruct_putu32(reply, u->tlength);
|
||||
pa_tagstruct_putu32(reply, u->prebuf);
|
||||
pa_tagstruct_putu32(reply, u->minreq);
|
||||
|
|
@ -1688,7 +1688,7 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
pa_tagstruct_putu32(reply, PA_INVALID_INDEX);
|
||||
pa_tagstruct_puts(reply, u->source_name);
|
||||
pa_tagstruct_putu32(reply, u->maxlength);
|
||||
pa_tagstruct_put_boolean(reply, !PA_SOURCE_IS_OPENED(pa_source_get_state(u->source)));
|
||||
pa_tagstruct_put_boolean(reply, !PA_SOURCE_IS_OPENED(u->source->state));
|
||||
pa_tagstruct_putu32(reply, u->fragsize);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ static void source_set_volume_cb(pa_source *s) {
|
|||
pa_source_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
if (!PA_SOURCE_IS_LINKED(s->state) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ static void source_set_mute_cb(pa_source *s) {
|
|||
pa_source_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
if (!PA_SOURCE_IS_LINKED(s->state) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
|
|||
|
||||
/* if uplink sink exists, pull data from there; simplify by using
|
||||
same length as chunk provided by source */
|
||||
if (u->sink && (pa_sink_get_state(u->sink) == PA_SINK_RUNNING)) {
|
||||
if (u->sink && (u->sink->thread_info.state == PA_SINK_RUNNING)) {
|
||||
pa_memchunk tchunk;
|
||||
size_t nbytes = chunk->length;
|
||||
pa_mix_info streams[2];
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_sink_assert_ref(s);
|
||||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
if (!PA_SINK_IS_LINKED(s->state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue