diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-22 08:15:41 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-22 08:15:41 (GMT) |
commit | b7ba409b0dabd382876310a6c110a96cf0e3c6bf (patch) | |
tree | d8843ca3efebd8c686c5ecd3ed594ff2733a9910 | |
parent | 60c195a1865e06026b54a5d8fd0036aaa010b8bc (diff) | |
parent | a006881b2297e4dbf03051f82a8abb1363ceeebb (diff) | |
download | Qt-b7ba409b0dabd382876310a6c110a96cf0e3c6bf.zip Qt-b7ba409b0dabd382876310a6c110a96cf0e3c6bf.tar.gz Qt-b7ba409b0dabd382876310a6c110a96cf0e3c6bf.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging:
Fix audio glitches in the audiooutput example.
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index bc2324e..451cc67 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -132,9 +132,9 @@ void Generator::generateData(const QAudioFormat &format, qint64 durationUs, int qint64 Generator::readData(char *data, qint64 len) { qint64 total = 0; - while (len - total) { + while (len - total > 0) { const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total); - memcpy(data, m_buffer.constData() + m_pos, chunk); + memcpy(data + total, m_buffer.constData() + m_pos, chunk); m_pos = (m_pos + chunk) % m_buffer.size(); total += chunk; } |