summaryrefslogtreecommitdiff
path: root/modules/sndio
diff options
context:
space:
mode:
Diffstat (limited to 'modules/sndio')
-rw-r--r--modules/sndio/sndio.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/sndio/sndio.c b/modules/sndio/sndio.c
index d3ca9d6..6ac4b67 100644
--- a/modules/sndio/sndio.c
+++ b/modules/sndio/sndio.c
@@ -154,6 +154,12 @@ static int src_alloc(struct ausrc_st **stp, const struct ausrc *as,
if (!stp || !as || !prm)
return EINVAL;
+ if (prm->fmt != AUFMT_S16LE) {
+ warning("sndio: source: unsupported sample format (%s)\n",
+ aufmt_name(prm->fmt));
+ return ENOTSUP;
+ }
+
name = (str_isset(device)) ? device : SIO_DEVANY;
if ((st = mem_zalloc(sizeof(*st), ausrc_destructor)) == NULL)
@@ -222,6 +228,12 @@ static int play_alloc(struct auplay_st **stp, const struct auplay *ap,
if (!stp || !ap || !prm)
return EINVAL;
+ if (prm->fmt != AUFMT_S16LE) {
+ warning("sndio: playback: unsupported sample format (%s)\n",
+ aufmt_name(prm->fmt));
+ return ENOTSUP;
+ }
+
name = (str_isset(device)) ? device : SIO_DEVANY;
if ((st = mem_zalloc(sizeof(*st), auplay_destructor)) == NULL)