mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
On platforms where nativeFormatForAudioDevice() is reliable, do not enumerate formats
This commit is contained in:
parent
c48ecb5f67
commit
a132dad486
1 changed files with 15 additions and 13 deletions
|
@ -616,23 +616,25 @@ bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice,
|
|||
|
||||
qCDebug(audioclient) << "The desired format for audio I/O is" << desiredAudioFormat;
|
||||
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_OSX)
|
||||
// As of Qt5.6, Android returns the native OpenSLES sample rate when possible, else 48000
|
||||
// Mac OSX returns the preferred CoreAudio format
|
||||
if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
if (IsWindows8OrGreater()) {
|
||||
// On Windows using WASAPI shared-mode, returns the internal mix format
|
||||
if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat);
|
||||
} // else enumerate formats
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
// Mac OSX returns the preferred CoreAudio format
|
||||
return nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat);
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
// As of Qt5.6, Android returns the native OpenSLES sample rate when possible, else 48000
|
||||
if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) {
|
||||
return true;
|
||||
} // else enumerate formats
|
||||
#endif
|
||||
|
||||
adjustedAudioFormat = desiredAudioFormat;
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue