Add pa_channels_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
channel count values.
This commit is contained in:
Tanu Kaskinen 2013-12-04 09:50:11 +02:00 committed by Peter Meerwald
parent a67318f8af
commit 2747c96101
12 changed files with 24 additions and 22 deletions

View file

@ -295,6 +295,10 @@ int pa_sample_format_valid(unsigned format) PA_GCC_PURE;
/** Return non-zero if the rate is within the supported range. \since 5.0 */
int pa_sample_rate_valid(uint32_t rate) PA_GCC_PURE;
/** Return non-zero if the channel count is within the supported range.
* \since 5.0 */
int pa_channels_valid(uint8_t channels) PA_GCC_PURE;
/** Return non-zero when the sample type specification is valid */
int pa_sample_spec_valid(const pa_sample_spec *spec) PA_GCC_PURE;