mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -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
|
|
@ -301,7 +301,7 @@ int pa_source_output_new(
|
|||
return -PA_ERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
pa_return_val_if_fail(PA_SOURCE_IS_LINKED(pa_source_get_state(data->source)), -PA_ERR_BADSTATE);
|
||||
pa_return_val_if_fail(PA_SOURCE_IS_LINKED(data->source->state), -PA_ERR_BADSTATE);
|
||||
pa_return_val_if_fail(!data->direct_on_input || data->direct_on_input->sink == data->source->monitor_of, -PA_ERR_INVALID);
|
||||
|
||||
/* Routing is done. We have a source and a format. */
|
||||
|
|
@ -390,7 +390,7 @@ int pa_source_output_new(
|
|||
return r;
|
||||
|
||||
if ((data->flags & PA_SOURCE_OUTPUT_NO_CREATE_ON_SUSPEND) &&
|
||||
pa_source_get_state(data->source) == PA_SOURCE_SUSPENDED) {
|
||||
data->source->state == PA_SOURCE_SUSPENDED) {
|
||||
pa_log("Failed to create source output: source is suspended.");
|
||||
return -PA_ERR_BADSTATE;
|
||||
}
|
||||
|
|
@ -612,7 +612,7 @@ void pa_source_output_unlink(pa_source_output*o) {
|
|||
reset_callbacks(o);
|
||||
|
||||
if (o->source) {
|
||||
if (PA_SOURCE_IS_LINKED(pa_source_get_state(o->source)))
|
||||
if (PA_SOURCE_IS_LINKED(o->source->state))
|
||||
pa_source_update_status(o->source);
|
||||
|
||||
o->source = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue