diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-06-21 05:11:59 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-06-22 01:44:31 (GMT) |
commit | b82ed43086aebb4698a8a52965eeb17349ef1d04 (patch) | |
tree | ab988c8f2fb32b4138fd6a6665d34602e84b1455 /src/multimedia | |
parent | 4cef0e055f2b519b405f90ce9cfcab90515e443e (diff) | |
download | Qt-b82ed43086aebb4698a8a52965eeb17349ef1d04.zip Qt-b82ed43086aebb4698a8a52965eeb17349ef1d04.tar.gz Qt-b82ed43086aebb4698a8a52965eeb17349ef1d04.tar.bz2 |
Audio(osx); Fix audio format converters.
Reviewed-by:Dmytro Poplavskiy
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/audio/qaudio_mac.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp index 14fee8b..4e17b52 100644 --- a/src/multimedia/audio/qaudio_mac.cpp +++ b/src/multimedia/audio/qaudio_mac.cpp @@ -68,11 +68,11 @@ QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf) audioFormat.setChannels(sf.mChannelsPerFrame); audioFormat.setSampleSize(sf.mBitsPerChannel); audioFormat.setCodec(QString::fromLatin1("audio/pcm")); - audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian); + audioFormat.setByteOrder((sf.mFormatFlags & kAudioFormatFlagIsBigEndian) != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian); QAudioFormat::SampleType type = QAudioFormat::UnSignedInt; - if ((sf.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) != 0) + if ((sf.mFormatFlags & kAudioFormatFlagIsSignedInteger) != 0) type = QAudioFormat::SignedInt; - else if ((sf.mFormatFlags & kLinearPCMFormatFlagIsFloat) != 0) + else if ((sf.mFormatFlags & kAudioFormatFlagIsFloat) != 0) type = QAudioFormat::Float; audioFormat.setSampleType(type); @@ -99,6 +99,9 @@ AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& au case QAudioFormat::Unknown: default: break; } + if (audioFormat.byteOrder() == QAudioFormat::BigEndian) + sf.mFormatFlags |= kAudioFormatFlagIsBigEndian; + return sf; } |