diff options
author | XANTRONIX Development | 2022-02-23 20:19:00 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-02-23 20:19:00 -0500 |
commit | a667236c6216641f0d6158d554335097f25ee373 (patch) | |
tree | b7b0dd6c2522b4d716f26fdbc706ecb801547e52 | |
parent | 52b99333c5e8cf3b757cd6e88fca13d420b54979 (diff) | |
download | xas-a667236c6216641f0d6158d554335097f25ee373.tar.gz xas-a667236c6216641f0d6158d554335097f25ee373.tar.bz2 xas-a667236c6216641f0d6158d554335097f25ee373.zip |
Implement xas_audio_format_eq()
Implement xas_audio_format_eq() to compare xas_audio_format objects
for equivalence
-rw-r--r-- | include/xas/audio.h | 2 | ||||
-rw-r--r-- | src/audio.c | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/xas/audio.h b/include/xas/audio.h index 4cf3221..d79615d 100644 --- a/include/xas/audio.h +++ b/include/xas/audio.h @@ -58,6 +58,8 @@ struct _xas_audio_stream { void *ctx; }; +int xas_audio_format_eq(xas_audio_format a, xas_audio_format b); + void xas_audio_zero(xas_audio_format format, void *dest, size_t index, 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 <xas/audio.h> +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, |