diff options
| author | Stephen Sinclair <radarsat1@gmail.com> | 2018-10-16 14:59:30 +0200 |
|---|---|---|
| committer | Stephen Sinclair <radarsat1@gmail.com> | 2018-10-16 14:59:30 +0200 |
| commit | 154627e9e314bc99d5f29a1675bdbd7a7c80c612 (patch) | |
| tree | fca28143f752c64a482090c569a2aa49445c071c /RtAudio.cpp | |
| parent | 2312b02c039b921b79ed52d448e8b3d932033f7a (diff) | |
| parent | 2f4e77da2a6e8eda6a174e067ffbb981e1acd142 (diff) | |
Merge remote-tracking branch 'upstream/pr/139'
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index 330ff28..77bd4b6 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -4114,10 +4114,9 @@ RtApiWasapi::RtApiWasapi() CLSCTX_ALL, __uuidof( IMMDeviceEnumerator ), ( void** ) &deviceEnumerator_ ); - if ( FAILED( hr ) ) { - errorText_ = "RtApiWasapi::RtApiWasapi: Unable to instantiate device enumerator"; - error( RtAudioError::DRIVER_ERROR ); - } + // If this runs on an old Windows, it will fail. Ignore and proceed. + if ( FAILED( hr ) ) + deviceEnumerator_ = NULL; } //----------------------------------------------------------------------------- @@ -4144,6 +4143,9 @@ unsigned int RtApiWasapi::getDeviceCount( void ) IMMDeviceCollection* captureDevices = NULL; IMMDeviceCollection* renderDevices = NULL; + if ( !deviceEnumerator_ ) + return 0; + // Count capture devices errorText_.clear(); HRESULT hr = deviceEnumerator_->EnumAudioEndpoints( eCapture, DEVICE_STATE_ACTIVE, &captureDevices ); |
