alsa-sink/source, sink, source: Consider sample format for avoid-resampling/passthrough
authorSangchul Lee <sangchul1011@gmail.com>
Thu, 15 Nov 2018 16:12:05 +0000 (01:12 +0900)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 16 Nov 2018 06:30:05 +0000 (08:30 +0200)
commit547998db4497b096d8aa424e5b2f5aa4c11514a9
tree066c0ad3e27158e57adc4ea4f1aac6e455b76fd3
parent73156649e76ac4000931990edcdcb3be31aade7b
alsa-sink/source, sink, source: Consider sample format for avoid-resampling/passthrough

Sample format(e.g. 16 bit, 24 bit) was not considered even if the
avoid-resampling option is set or the passthrough mode is used.
This patch checks both sample format and rate of a stream to
determine whether to avoid resampling in case of the option is set.
In other word, it is possble to use the stream's original sample
format and rate without resampling as long as these are supported
by the device.

pa_sink_input_update_rate() and pa_source_output_update_rate() are
renamed to pa_sink_input_update_resampler() and pa_source_output
_update_resampler() respectively.

functions are added as below.
 pa_sink_set_sample_format(), pa_sink_set_sample_rate(),
 pa_source_set_sample_format(), pa_source_set_sample_rate()

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c
src/modules/module-null-sink.c
src/pulsecore/sink-input.c
src/pulsecore/sink-input.h
src/pulsecore/sink.c
src/pulsecore/sink.h
src/pulsecore/source-output.c
src/pulsecore/source-output.h
src/pulsecore/source.c
src/pulsecore/source.h