mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
Add pa_sample_format_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 the sample format value.
This commit is contained in:
parent
643eb5bae2
commit
1cda717252
8 changed files with 30 additions and 45 deletions
|
|
@ -289,6 +289,9 @@ size_t pa_usec_to_bytes(pa_usec_t t, const pa_sample_spec *spec) PA_GCC_PURE;
|
|||
* pa_sample_spec_valid() will fail for it. \since 0.9.13 */
|
||||
pa_sample_spec* pa_sample_spec_init(pa_sample_spec *spec);
|
||||
|
||||
/** Return non-zero if the given integer is a valid sample format. \since 5.0 */
|
||||
int pa_sample_format_valid(unsigned format) 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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue