Fixed a hang of the QAudioOutput auto test on Mac OS X
Task-number: QTMOBILITY-1779 Change-Id: If4141ed848dd0475b0008ec85daba55fa5f086b3 Reviewed-on: http://codereview.qt.nokia.com/1805 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
@@ -108,9 +108,14 @@ public:
|
||||
QAudioRingBuffer::Region region = m_buffer->acquireReadRegion((maxFrames - framesRead) * m_bytesPerFrame);
|
||||
|
||||
if (region.second > 0) {
|
||||
// Ensure that we only read whole frames.
|
||||
region.second -= region.second % m_bytesPerFrame;
|
||||
memcpy(data + (framesRead * m_bytesPerFrame), region.first, region.second);
|
||||
framesRead += region.second / m_bytesPerFrame;
|
||||
|
||||
if (region.second > 0) {
|
||||
memcpy(data + (framesRead * m_bytesPerFrame), region.first, region.second);
|
||||
framesRead += region.second / m_bytesPerFrame;
|
||||
} else
|
||||
wecan = false; // If there is only a partial frame left we should exit.
|
||||
}
|
||||
else
|
||||
wecan = false;
|
||||
|
||||
Reference in New Issue
Block a user