Skip to content

Commit

Permalink
Merge pull request #393 from cannerycoders/asiobug
Browse files Browse the repository at this point in the history
Asio probe infinite-loop fix.
  • Loading branch information
garyscavone committed Apr 3, 2023
2 parents 268e64a + e16004f commit 3a60c27
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions RtAudio.cpp
Expand Up @@ -3370,7 +3370,6 @@ RtApiAsio :: ~RtApiAsio()
void RtApiAsio :: probeDevices( void )
{
// See list of required functionality in RtApi::probeDevices().

unsigned int nDevices = drivers.asioGetNumDev();
if ( nDevices == 0 ) {
deviceList_.clear();
Expand Down Expand Up @@ -3416,9 +3415,13 @@ void RtApiAsio :: probeDevices( void )

// Asio doesn't provide default devices so call the getDefault
// functions, which will set the first available input and output
// devices as the defaults.
getDefaultInputDevice();
getDefaultOutputDevice();
// devices as the defaults. Don't call getDefaultXXXDevice if
// deviceList is empty.
if(deviceList_.size() > 0)
{
getDefaultInputDevice();
getDefaultOutputDevice();
}
}

bool RtApiAsio :: probeDeviceInfo( RtAudio::DeviceInfo &info )
Expand Down

0 comments on commit 3a60c27

Please sign in to comment.