summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-06-22 02:01:51 (GMT)
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 10:06:20 (GMT)
commit35606b224dc8bd25ea5d4a651491cb4c76d5fbc2 (patch)
tree31653b423689355fb6321ff22cc71ee5f6e57660
parent4989189182fd56acbc2dad170f2969cad336dc72 (diff)
downloadQt-35606b224dc8bd25ea5d4a651491cb4c76d5fbc2.zip
Qt-35606b224dc8bd25ea5d4a651491cb4c76d5fbc2.tar.gz
Qt-35606b224dc8bd25ea5d4a651491cb4c76d5fbc2.tar.bz2
Audio(osx); Fix period size calculation.
Task-number: QTBUG-8878 Reviewed-by:Dmytro Poplavskiy (cherry picked from commit 76c256bdabcc207a6ed70d5b5b62698495548a25)
-rw-r--r--src/multimedia/audio/qaudiooutput_mac_p.cpp15
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 21206db..31a66eb 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