summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXANTRONIX Development2022-02-23 20:19:34 -0500
committerXANTRONIX Development2022-02-23 20:22:46 -0500
commit3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5 (patch)
tree90970e1c50dc8dd2e87a492aedaa00d4f4231809 /src
parenta667236c6216641f0d6158d554335097f25ee373 (diff)
downloadxas-3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5.tar.gz
xas-3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5.tar.bz2
xas-3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5.zip
Ensure xas_bank_record() uses same audio format
Diffstat (limited to 'src')
-rw-r--r--src/bank.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bank.c b/src/bank.c
index 19e3514..2f6151b 100644
--- a/src/bank.c
+++ b/src/bank.c
@@ -46,6 +46,12 @@ ssize_t xas_bank_record(xas_bank *bank,
size_t left = count,
index_o = 0;
+ if (!xas_audio_format_eq(bank->format, input->format)) {
+ errno = EINVAL;
+
+ goto error_invalid_format;
+ }
+
if (count > bank->entry_size) {
count = bank->entry_size;
}
@@ -74,6 +80,7 @@ ssize_t xas_bank_record(xas_bank *bank,
return entry->duration = index_o;
error_audio_stream_read:
+error_invalid_format:
return -1;
}