mirror of
https://github.com/overte-org/overte.git
synced 2025-04-17 01:56:39 +02:00
Improved failure logs
This commit is contained in:
parent
ec53c6a030
commit
fd08936fb3
1 changed files with 9 additions and 3 deletions
|
@ -395,10 +395,16 @@ bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice,
|
|||
adjustedAudioFormat.setSampleType(QAudioFormat::SignedInt);
|
||||
adjustedAudioFormat.setByteOrder(QAudioFormat::LittleEndian);
|
||||
|
||||
assert(audioDevice.isFormatSupported(adjustedAudioFormat));
|
||||
|
||||
if (!audioDevice.isFormatSupported(adjustedAudioFormat)) {
|
||||
qCDebug(audioclient) << "WARNING: The mix format is" << adjustedAudioFormat << "but isFormatSupported() failed.";
|
||||
return false;
|
||||
}
|
||||
// converting to/from this rate must produce an integral number of samples
|
||||
return (adjustedAudioFormat.sampleRate() * AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL % AudioConstants::SAMPLE_RATE == 0);
|
||||
if (adjustedAudioFormat.sampleRate() * AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL % AudioConstants::SAMPLE_RATE != 0) {
|
||||
qCDebug(audioclient) << "WARNING: The current sample rate [" << adjustedAudioFormat.sampleRate() << "] is not supported.";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
#elif defined(Q_OS_ANDROID)
|
||||
// FIXME: query the native sample rate of the device?
|
||||
|
|
Loading…
Reference in a new issue