diff options
author | Georg Chini <georg@chini.tk> | 2017-04-14 15:03:56 +0200 |
---|---|---|
committer | Georg Chini <georg@chini.tk> | 2017-04-14 15:03:56 +0200 |
commit | a42241ec95c0ee9c991e4c3c19576c3e5e2c042e (patch) | |
tree | 877e7086bc890018b8c7f72ef4a81d4a025bd661 /src | |
parent | f3265f944ae89c2b38c9dac6e5383f21d238d296 (diff) | |
download | pulseaudio-a42241ec95c0ee9c991e4c3c19576c3e5e2c042e.tar.gz |
sample.c: Allow module-loopback to exceed PA_RATE_MAX
The rate set by module loopback may exceed PA_RATE_MAX by 1%, therefore
allow rates higher than PA_RATE_MAX in pa_sample_rate_valid().
Diffstat (limited to 'src')
-rw-r--r-- | src/pulse/sample.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pulse/sample.c b/src/pulse/sample.c index cb0425410..ff77985c5 100644 --- a/src/pulse/sample.c +++ b/src/pulse/sample.c @@ -105,7 +105,10 @@ int pa_sample_format_valid(unsigned format) { } int pa_sample_rate_valid(uint32_t rate) { - return rate > 0 && rate <= PA_RATE_MAX; + /* The extra 1% is due to module-loopback: it temporarily sets + * a higher-than-nominal rate to get rid of excessive buffer + * latency */ + return rate > 0 && rate <= PA_RATE_MAX * 101 / 100; } int pa_channels_valid(uint8_t channels) { |