diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-06-22 02:01:51 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-06-22 03:10:53 (GMT) |
commit | 76c256bdabcc207a6ed70d5b5b62698495548a25 (patch) | |
tree | 977ed82b80c521a282987487602c56f7a440689b /src/multimedia | |
parent | 66d02e4bde0a628978436217032abe555ed77fad (diff) | |
download | Qt-76c256bdabcc207a6ed70d5b5b62698495548a25.zip Qt-76c256bdabcc207a6ed70d5b5b62698495548a25.tar.gz Qt-76c256bdabcc207a6ed70d5b5b62698495548a25.tar.bz2 |
Audio(osx); Fix period size calculation.
Task-number: QTBUG-8878
Reviewed-by:Dmytro Poplavskiy
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/audio/qaudiooutput_mac_p.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp index 9689101..cc52d90 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.cpp +++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp @@ -358,17 +358,7 @@ bool QAudioOutputPrivate::open() // Set stream format streamFormat = toAudioStreamBasicDescription(audioFormat); - UInt32 size = sizeof(deviceFormat); - if (AudioUnitGetProperty(audioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &deviceFormat, - &size) != noErr) { - qWarning() << "QAudioOutput: Unable to retrieve device format"; - return false; - } - + UInt32 size = sizeof(streamFormat); if (AudioUnitSetProperty(audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, @@ -392,8 +382,7 @@ bool QAudioOutputPrivate::open() return false; } - periodSizeBytes = (numberOfFrames * streamFormat.mSampleRate / deviceFormat.mSampleRate) * - streamFormat.mBytesPerFrame; + periodSizeBytes = numberOfFrames * streamFormat.mBytesPerFrame; if (internalBufferSize < periodSizeBytes * 2) internalBufferSize = periodSizeBytes * 2; else |