pulse: Expose the correct max rate that we support
authorArun Raghavan <arunsr@codeaurora.org>
Mon, 19 Nov 2018 14:35:39 +0000 (20:05 +0530)
committerArun Raghavan <arun@arunraghavan.net>
Mon, 19 Nov 2018 15:58:25 +0000 (21:28 +0530)
commita24ef929a4b0107964390931da5dcb234035a105
tree4fbb9a9f09a6a6c5098410178a84ce57729395d8
parent753b7c17f35994cc29f4bac0a087d040b25cae48
pulse: Expose the correct max rate that we support

PulseAudio defines PA_RATE_MAX as the maximum sampling rate that it
supports. We were previously exposing a maximum rate of INT_MAX, which
is incorrect, but worked because nothing was really using a rate greater
than 384000 kHz.

While playing DSD data, we hit a case where there might be very high
sample rates (>1MHz), and pulsesink fails during stream creation with
such streams because it erroneously advertises that it supports such
rates.

Since PA_RATE_MAX is #define'd to (8*48000U), we can't just use it in
the caps string. Instead, we fix up the rate to what we actually support
whenever we use our macro caps.
ext/pulse/pulsesink.c
ext/pulse/pulsesrc.c
ext/pulse/pulseutil.c
ext/pulse/pulseutil.h