audio_format: added audio_format_valid()
This commit is contained in:
parent
774417f12f
commit
be9e60d55e
|
@ -40,6 +40,17 @@ static inline bool audio_format_defined(const struct audio_format *af)
|
|||
return af->sample_rate != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false if the format is not valid for playback with MPD.
|
||||
* This function performs some basic validity checks.
|
||||
*/
|
||||
static inline bool audio_format_valid(const struct audio_format *af)
|
||||
{
|
||||
return af->sample_rate > 0 &&
|
||||
(af->bits == 8 || af->bits == 16 || af->bits == 24) &&
|
||||
af->channels >= 1;
|
||||
}
|
||||
|
||||
static inline bool audio_format_equals(const struct audio_format *a,
|
||||
const struct audio_format *b)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue