sink-input, source-output: Assign to reference_ratio from a single place

This makes it easy to log a message every time the reference ratio
changes. I also need to add a hook for reference ratio changes, but
that need will go away if the stream relative volume controls will be
created by the core in the future.
shell-completion: Install the Zsh completions

This makes the Zsh completions work out-of-the-box. I also moved
pulseaudio-zsh-completion.zsh to zsh/_pulseaudio to be in line with
the common naming convention of Zsh completion files.
shell-completion: zsh: Move duplicated code into a function

This is just refactoring, no functional changes.
shell-completion: zsh: Support also --server in remote detection

_set_remote() is supposed to find out if a remote server has been
specified on the command line, but previously it only checked for -s
and ignored --server, causing the completion code to connect to the
local server instead when it should have connected to the remote
server to get the data for the completions.
shell-completion: zsh: Don't say "this help" when it's a different help

The option descriptions that Zsh prints are not the same thing as the
help text that pactl, pacmd etc. print when given --help.
shell-completion: zsh: Don't use multiple option sets for one command

The options were divided to multiple sets to prevent (or at least try
to prevent) completing e.g. --server after -s was already given. This,
however, caused problems, because after the user had written
"pactl --server foo", further completions stopped to work. The
"server" option set didn't contain any other options, so once Zsh
detected that the "server" option set was in use, it thought that no
other options were valid.

The special casing for "-s", "-n", "--server" and "--client-*" at the
end of _pactl_completion() was probably an attempt to deal with this
problem. Those special cases are unnecessary now that the option
specification given to _arguments is more correct.
shell-completion: zsh: Use -S and -A with _arguments

-S makes the option parser to not try parsing arguments as options
after "--" has appeared in the command line.

-A "-*" makes the option parser to not try parsing arguments as
options after the first non-option argument. The "-*" pattern means
that if there are unrecognized parameters that look like options
(i.e. start with a dash), those should not terminate the option
parsing.
shell-completion: zsh: Add "=" to the end of some command options

Without the equals sign, only the "--server foo" form is recognized,
so the "--server=foo" form doesn't get completion support.
resampler: Split the resampler implementations into separate files

Rebased by Peter Meerwald.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: poljar (Damir Jelić) <poljarinho@gmail.com>
resampler: Moved speex_is_fixed_point() to speex.c

IMHO code that calls into speex belongs in speex.c, not in resampler.c.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
resampler: Changed style of includes

There was no code that included files from other directories using
the #include "..." style before.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
echo-cancel: Fix drift timer restart logic across suspend

The IS_ACTIVE() macro does a pa_sink/source_get_state() on our sink and
source, which does not work in the state change callback, since the
state is not actually committed at that point.
remap: Add 4-channel to mono channel rearrangement

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
alsa-mixer: Fix path subset detection

The old logic assumed that if path A was a subset of path B, the
element list in B would have all elements of A in the beginning of
B's list, in the same order as A. This assumption was invalid, causing
some subset cases to not get detected. We need to search through the
full element list of B every time before we can conclude that B
doesn't have the element that we're inspecting.
device-restore: Sync the database on unload

If there are unsaved changes, those need to be written to disk before
the module is unloaded, otherwise the changes are lost.
tests: Add *.log and *.trs to src/.gitignore

these files are created by running 'make check'

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
echo-cancel: Fix spelling of canceller

use canceller consistently

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
misc: Fix format specifiers

to print a pa_usec_t, the format specifier to use is "%" PRIu64

modules/module-combine-sink.c: In function 'update_latency_range':
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'pa_usec_t' [-Wformat]
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'pa_usec_t' [-Wformat]

to print a size_t, use %zu

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
core-util: Avoid warnings when missing certain system calls

on systems lacking #defines HAVE_ACCEPT4, HAVE_PIPE2, SOCK_CLOEXEC

pulsecore/core-util.c: In function 'pa_open_cloexec':
pulsecore/core-util.c:3348:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_socket_cloexec':
pulsecore/core-util.c:3370:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_pipe_cloexec':
pulsecore/core-util.c:3393:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_accept_cloexec':
pulsecore/core-util.c:3415:1: warning: label 'finish' defined but not used [-Wunused-label]

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
tests: Check expected result of sigbus-test

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>