From a667236c6216641f0d6158d554335097f25ee373 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 23 Feb 2022 20:19:00 -0500 Subject: Implement xas_audio_format_eq() Implement xas_audio_format_eq() to compare xas_audio_format objects for equivalence --- src/audio.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index da656f2..bc2e04d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -4,6 +4,12 @@ #include +int xas_audio_format_eq(xas_audio_format a, xas_audio_format b) { + return a.channels == b.channels + && a.sample_size == b.sample_size + && a.sample_rate == b.sample_rate; +} + void xas_audio_copy(xas_audio_format format, void *dest, void *src, -- cgit v1.2.3