summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Tomlinson <themarcustomlinson@gmail.com>2022-07-10 22:09:13 +0100
committerMarcus Tomlinson <themarcustomlinson@gmail.com>2022-07-10 22:09:13 +0100
commit7887bcfd13e46739758d39ea362bd1e32980efa9 (patch)
tree0c76a6a0b98cc3348d3e0d35aac333bda7fbdecb
parent92d578b5cc02f50eb5ab1798c2a85a5348785e82 (diff)
WASAPI : Continue probe when in or out devices N/A
-rw-r--r--RtAudio.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index 474c111..5913a26 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -4953,32 +4953,26 @@ void RtApiWasapi::probeDevices( void )
// Get the default capture device Id.
hr = deviceEnumerator_->GetDefaultAudioEndpoint( eCapture, eConsole, &devicePtr );
- if ( FAILED( hr ) ) {
- errorText_ = "RtApiWasapi::probeDevices: Unable to retrieve default capture device handle.";
- goto Exit;
+ if ( SUCCEEDED( hr) ) {
+ hr = devicePtr->GetId( &defaultCaptureId );
+ if ( FAILED( hr ) ) {
+ errorText_ = "RtApiWasapi::probeDevices: Unable to get default capture device Id.";
+ goto Exit;
+ }
+ defaultCaptureString = convertCharPointerToStdString( defaultCaptureId );
}
- hr = devicePtr->GetId( &defaultCaptureId );
- if ( FAILED( hr ) ) {
- errorText_ = "RtApiWasapi::probeDevices: Unable to get default capture device Id.";
- goto Exit;
- }
- defaultCaptureString = convertCharPointerToStdString( defaultCaptureId );
-
// Get the default render device Id.
SAFE_RELEASE( devicePtr );
hr = deviceEnumerator_->GetDefaultAudioEndpoint( eRender, eConsole, &devicePtr );
- if ( FAILED( hr ) ) {
- errorText_ = "RtApiWasapi::probeDevices: Unable to retrieve default render device handle.";
- goto Exit;
- }
-
- hr = devicePtr->GetId( &defaultRenderId );
- if ( FAILED( hr ) ) {
- errorText_ = "RtApiWasapi::probeDevices: Unable to get default render device Id.";
- goto Exit;
+ if ( SUCCEEDED( hr) ) {
+ hr = devicePtr->GetId( &defaultRenderId );
+ if ( FAILED( hr ) ) {
+ errorText_ = "RtApiWasapi::probeDevices: Unable to get default render device Id.";
+ goto Exit;
+ }
+ defaultRenderString = convertCharPointerToStdString( defaultRenderId );
}
- defaultRenderString = convertCharPointerToStdString( defaultRenderId );
// Collect device IDs with mode.
for ( unsigned int n=0; n<nDevices; n++ ) {