diff options
author | Bryce Van Dyk <[email protected]> | 2018-01-18 12:02:09 -0500 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2018-01-23 08:50:28 +1300 |
commit | 4945f4a7b20b4af9fd27248c23330c60f8e1f653 (patch) | |
tree | 57feefc2ba2a7d5825371e23dd89d94bfe1edf2c /src/cubeb_winmm.c | |
parent | 9e28c426706c6b7c43a21e24052ac4cfcf19e631 (diff) | |
download | cubeb-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_winmm.c')
-rw-r--r-- | src/cubeb_winmm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cubeb_winmm.c b/src/cubeb_winmm.c index b5aab51..e62eed6 100644 --- a/src/cubeb_winmm.c +++ b/src/cubeb_winmm.c @@ -414,6 +414,11 @@ winmm_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n return CUBEB_ERROR_DEVICE_UNAVAILABLE; } + if (output_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK) { + /* Loopback is not supported */ + return CUBEB_ERROR_NOT_SUPPORTED; + } + *stream = NULL; memset(&wfx, 0, sizeof(wfx)); |