mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-07 04:10:08 +00:00
Workaround for CoreAudio devices that don't change sample rate correctly in 10.6; improvement to WASAPI error reporting
This commit is contained in:
parent
687c08c939
commit
b171ae8400
3 changed files with 124 additions and 174 deletions
|
|
@ -599,7 +599,6 @@ public:
|
|||
defaultBufferSize = jmax (inputDevice->defaultBufferSize, outputDevice->defaultBufferSize);
|
||||
sampleRates = inputDevice->rates;
|
||||
sampleRates.removeValuesNotIn (outputDevice->rates);
|
||||
jassert (sampleRates.size() > 0); // in and out devices don't share any common sample rates!
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -674,6 +673,12 @@ public:
|
|||
close();
|
||||
lastError = String::empty;
|
||||
|
||||
if (sampleRates.size() == 0 && inputDevice != 0 && outputDevice != 0)
|
||||
{
|
||||
lastError = "The input and output devices don't share a common sample rate!";
|
||||
return lastError;
|
||||
}
|
||||
|
||||
currentBufferSizeSamples = bufferSizeSamples <= 0 ? defaultBufferSize : jmax (bufferSizeSamples, minBufferSize);
|
||||
currentSampleRate = sampleRate > 0 ? sampleRate : defaultSampleRate;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue