aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_winmm.c
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2016-09-09 18:22:11 +1200
committerMatthew Gregan <[email protected]>2016-09-09 18:29:11 +1200
commite9d40b7af028f9241c95fa2a40b6dd4af37b79d1 (patch)
treee7c0190819feb17376d49896b5e4003c71a467b2 /src/cubeb_winmm.c
parente72969814953213645a139e1a19766d71fc697c2 (diff)
downloadcubeb-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.c5
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);