aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_sndio.c
diff options
context:
space:
mode:
authorBryce Van Dyk <[email protected]>2018-01-18 12:02:09 -0500
committerMatthew Gregan <[email protected]>2018-01-23 08:50:28 +1300
commit4945f4a7b20b4af9fd27248c23330c60f8e1f653 (patch)
tree57feefc2ba2a7d5825371e23dd89d94bfe1edf2c /src/cubeb_sndio.c
parent9e28c426706c6b7c43a21e24052ac4cfcf19e631 (diff)
downloadcubeb-4945f4a7b20b4af9fd27248c23330c60f8e1f653.tar.gz
cubeb-4945f4a7b20b4af9fd27248c23330c60f8e1f653.zip
Non-wasapi backends return errors if loopback is requested.
Loopback is not supported outside of WASAPI, so if it's requested an error is returned. This error is set to indicate loopback is not supported in most cases. Though in some cases a generic error is returned to avoid complicating existing code. The current API means requesting a loopback for an output stream doesn't make sense. However, to keep handling simplified both input and output params are handled in the same or similar fashion by this commit. Both kinds of request should fail, but no extra indication is given that requesting output loopback is aberrant (since it will fail anyway).
Diffstat (limited to 'src/cubeb_sndio.c')
-rw-r--r--src/cubeb_sndio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c
index c470a29..1699677 100644
--- a/src/cubeb_sndio.c
+++ b/src/cubeb_sndio.c
@@ -279,11 +279,19 @@ sndio_stream_init(cubeb * context,
memset(s, 0, sizeof(cubeb_stream));
s->mode = 0;
if (input_stream_params) {
+ if (input_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK) {
+ DPR("sndio_stream_init(), loopback not supported\n");
+ goto err;
+ }
s->mode |= SIO_REC;
format = input_stream_params->format;
rate = input_stream_params->rate;
}
if (output_stream_params) {
+ if (output_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK) {
+ DPR("sndio_stream_init(), loopback not supported\n");
+ goto err;
+ }
s->mode |= SIO_PLAY;
format = output_stream_params->format;
rate = output_stream_params->rate;