diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-05-21 12:27:42 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-05-21 12:28:37 +0000 |
commit | 6e93058aa909875225319edf1ebb4d2d1697d527 (patch) | |
tree | 7b6673d05517667402b0ff83a3819d94d6a8116c | |
parent | 83b7c12ec6cab141e9e21135ce67346e10cc41d8 (diff) | |
download | qtmultimedia-6e93058aa909875225319edf1ebb4d2d1697d527.tar.gz |
Make the QAudioFormat autotest pass on macOS
QWaveDecoder can only write Int16 based formats, so skip the preferred
format if it is not Int16 based (macOS seems to prefer Float). Also
ensure that all formats are valid by giving them a valid channel count.
Change-Id: I0cf4c040eb28b4dbf1faebd1293fe035c8144dc6
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp index 8b20649b9..488c803fd 100644 --- a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp @@ -176,10 +176,13 @@ void tst_QAudioOutput::initTestCase() QAudioFormat format; - if (audioDevice.isFormatSupported(audioDevice.preferredFormat())) - testFormats.append(audioDevice.preferredFormat()); + if (audioDevice.isFormatSupported(audioDevice.preferredFormat())) { + if (format.sampleFormat() == QAudioFormat::Int16) + testFormats.append(audioDevice.preferredFormat()); + } // PCM 11025 mono S16LE + format.setChannelCount(1); format.setSampleRate(11025); format.setSampleFormat(QAudioFormat::Int16); if (audioDevice.isFormatSupported(format)) |