diff options
author | Matthew Gregan <[email protected]> | 2016-09-09 18:22:11 +1200 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2016-09-09 18:29:11 +1200 |
commit | e9d40b7af028f9241c95fa2a40b6dd4af37b79d1 (patch) | |
tree | e7c0190819feb17376d49896b5e4003c71a467b2 /src/cubeb_winmm.c | |
parent | e72969814953213645a139e1a19766d71fc697c2 (diff) | |
download | cubeb-e9d40b7af028f9241c95fa2a40b6dd4af37b79d1.tar.gz cubeb-e9d40b7af028f9241c95fa2a40b6dd4af37b79d1.zip |
winmm: Check output device count before initializing.
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 65bb1ed..6499c78 100644 --- a/src/cubeb_winmm.c +++ b/src/cubeb_winmm.c @@ -310,6 +310,11 @@ winmm_init(cubeb ** context, char const * context_name) XASSERT(context); *context = NULL; + /* Don't initialize a context if there are no devices available. */ + if (waveOutGetNumDevs() == 0) { + return CUBEB_ERROR; + } + ctx = calloc(1, sizeof(*ctx)); XASSERT(ctx); |