sink, source: remove the state getters
authorTanu Kaskinen <tanuk@iki.fi>
Tue, 26 Jun 2018 13:25:58 +0000 (16:25 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Mon, 2 Jul 2018 18:23:13 +0000 (21:23 +0300)
commit6665b466d28ca6f166c22846777f541f5bc9cef7
tree32c37a04ae188ef0690adfe69967bd262efa9253
parentb4a36453da7647ece7797dcca1628f7878aab870
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.
26 files changed:
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c
src/modules/dbus/iface-device.c
src/modules/echo-cancel/module-echo-cancel.c
src/modules/module-combine-sink.c
src/modules/module-equalizer-sink.c
src/modules/module-intended-roles.c
src/modules/module-ladspa-sink.c
src/modules/module-loopback.c
src/modules/module-rescue-streams.c
src/modules/module-stream-restore.c
src/modules/module-suspend-on-idle.c
src/modules/module-tunnel.c
src/modules/module-virtual-sink.c
src/modules/module-virtual-source.c
src/modules/module-virtual-surround-sink.c
src/pulsecore/cli-command.c
src/pulsecore/cli-text.c
src/pulsecore/core.c
src/pulsecore/protocol-esound.c
src/pulsecore/protocol-native.c
src/pulsecore/sink-input.c
src/pulsecore/sink.h
src/pulsecore/source-output.c
src/pulsecore/source.c
src/pulsecore/source.h