Skip to content

Commit

Permalink
Add default sample rate to the supported sample rate list if we can't…
Browse files Browse the repository at this point in the history
… find any supported ones.
  • Loading branch information
tmiw committed Apr 13, 2024
1 parent c767ed9 commit 69a90aa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/audio/PortAudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,15 @@ std::vector<int> PortAudioEngine::getSupportedSampleRates(wxString deviceName, A
}

rateIndex++;
}
}

// If we can't find a supported sample rate, just assume that the
// default sample rate is supported. If that can't actually be used,
// we can deal with it later.
if (result.size() == 0)
{
result.push_back(device.defaultSampleRate);
}
}
}

Expand Down Expand Up @@ -273,4 +281,4 @@ bool PortAudioEngine::IsDeviceWhitelisted_(const char* devName)
!strcmp(devName, "vdownmix") ||
!strcmp(devName, "dmix") ||
!strcmp(devName, "default");
}
}

0 comments on commit 69a90aa

Please sign in to comment.