aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_kai.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_kai.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_kai.c')
-rw-r--r--src/cubeb_kai.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cubeb_kai.c b/src/cubeb_kai.c
index 4ce0ae7..741a1ea 100644
--- a/src/cubeb_kai.c
+++ b/src/cubeb_kai.c
@@ -171,6 +171,11 @@ kai_stream_init(cubeb * context, cubeb_stream ** stream,
if (!output_stream_params)
return CUBEB_ERROR_INVALID_PARAMETER;
+ // Loopback is unsupported
+ if (output_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK) {
+ return CUBEB_ERROR_NOT_SUPPORTED;
+ }
+
if (output_stream_params->channels < 1 ||
output_stream_params->channels > MAX_CHANNELS)
return CUBEB_ERROR_INVALID_FORMAT;