summaryrefslogtreecommitdiff
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2013-12-04 09:50:10 +0200
committerPeter Meerwald <pmeerw@pmeerw.net>2013-12-15 11:21:56 +0100
commita67318f8affc4973507811946708bc17e63f1ec7 (patch)
tree197125b1e11f01d42d6cb8e3654b17149b5bce03 /src/pulsecore/sink.c
parent1cda71725240bd4911f0f34c5d384b3966f06369 (diff)
downloadpulseaudio-a67318f8affc4973507811946708bc17e63f1ec7.tar.gz
Add pa_sample_rate_valid()
I think this makes the code a bit nicer to read and write. This also reduces the chances of off-by-one errors when checking the bounds of sample rate values.
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 95cf9b677..672a884fd 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1420,8 +1420,7 @@ int pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough) {
}
}
- if (PA_UNLIKELY (desired_rate < 8000 ||
- desired_rate > PA_RATE_MAX))
+ if (PA_UNLIKELY(!pa_sample_rate_valid(desired_rate)))
return -1;
if (!passthrough) {