sink, source: Return early from pa_*_update_rate(), if there's no need to do anything
resampler: Make resampler struct implementation agnostic

The pa_resampler struct contains many implementation specific
structures. These create overhead and don't belong there anyways.

This patch moves the implementation specific structures out of the
pa_resampler structure.
resampler: Move the fix method logic into a separate function
resampler: fix_method use switch instead of if/else

This way the fix method function should be more readable and easier to
expand in the future.
resampler: Move the work format finding logic into a separate function
resampler: choose_work_format use switch instead of if/else

This way the function for choosing the work format should
be more readable and easier to expand in the future.
resampler: Add a function for comparing sample format precision
Resampler: Don't use the peaks resampler for upsampling

This patch fixes this assertion:
    Assertion 'r->i_ss.rate >= r->o_ss.rate' failed at ../../src/pulsecore/resampler.c:1744, function peaks_init(). Aborting.
resampler: Introduce a implementation specific struct

This struct holds all the implementation specific data in one place.
resampler: Add assert to set_input/output_rate

This adds asserts to check if the implementation has an update rate
function defined for the unlikely event that some implementation forgets
to assign a update rate function we can simply bail.

It is expected from the resampling implementations to have such a
function even if the state of the resampler is completely reset.
resampler: Get rid of redundant implementation specific structs

This patch removes implementation specific structs that contain a single
member.
resampler: Add a choose_auto_resampler function

This function returns our preferred resampler if the user choose the
auto (or if he has chosen an unsupported) resampler.
source: Fix monitor source rate changing

When a sink changes its sample rate, also the monitor source rate
needs to be changed. In order to determine whether a source supports
rate changing, the code checks if the update_rate() callback is set,
but monitor sources don't have that callback set, so the old code
always failed to change the monitor source rate.

This patch fixes the monitor source rate changing by handling monitor
sources as a special case in pa_source_update_rate(): if the source is
a monitor source, then the update_rate() callback is not required.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=66424
source: When updating a monitor source's rate, update the sink rate too

If the sink rate is not updated, then the monitor source will appear
to have a different rate than the sink, but in reality there's never
any resampling done when moving data from the sink to the monitor
source, so it's a lie that the monitor source has a different rate.
The result of lying is that clients that capture from the monitor
source will have streams that run too fast or slow.
sink, source: Fix error reporting style for rate updates
context: add pa_context_load_cookie_from_file()

There is no function to load the authentication cookie for a context.
You can only set environment variables. This patch adds
pa_context_load_cookie_from_file().

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
card-restore: Watch for profiles added after card creation.

This patch adds the ability to restore profiles if they are added after
card creation.

Adding profiles after card creation mainly happens for bluetooth cards.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=65349
resampler: Never return zero for max block size

With very low input sample rates the memory pool max block size may
not be big enough, in which case we should return the size of one
frame. Returning zero caused crashing.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=68616
i18n: Japanese translation update
tunnel-source-new: counterpart to module-tunnel-sink-new

The old tunnel module duplicates functionality that is in libpulse,
due to implementing the native protocol, and the protocol code in
the old tunnel module tends to get broken every now and then, because
people forget to update the tunnel module protocol implementation
when changing the native protocol. module-tunnel-source-new avoids this
problem by using libpulse to communicate with the remote server.