diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-07-10 10:14:36 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-07-10 10:14:36 +0200 |
commit | 074bd6ab37bbbb4dbba188921783fd98be872555 (patch) | |
tree | 318284e5ce86569c6d0c9c37d143b6f63781eede /examples | |
parent | 4ba4f1a51db14c1df20b27cc375255077f051819 (diff) | |
parent | 8da61153c9b4e505b6f8a0e7a6c630690516d845 (diff) | |
download | qtmultimedia-074bd6ab37bbbb4dbba188921783fd98be872555.tar.gz |
Merge remote-tracking branch 'origin/5.3' into dev
Change-Id: I38ebcb3da0e4d2acc9e7108c9579ea98323864e0
Diffstat (limited to 'examples')
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.cpp | 15 | ||||
-rw-r--r-- | examples/multimedia/video/doc/src/qmlvideofx.qdoc | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index fdb640dc2..daa7bfdf6 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -66,7 +66,8 @@ Generator::Generator(const QAudioFormat &format, : QIODevice(parent) , m_pos(0) { - generateData(format, durationUs, sampleRate); + if (format.isValid()) + generateData(format, durationUs, sampleRate); } Generator::~Generator() @@ -133,11 +134,13 @@ void Generator::generateData(const QAudioFormat &format, qint64 durationUs, int qint64 Generator::readData(char *data, qint64 len) { qint64 total = 0; - while (len - total > 0) { - const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total); - memcpy(data + total, m_buffer.constData() + m_pos, chunk); - m_pos = (m_pos + chunk) % m_buffer.size(); - total += chunk; + if (!m_buffer.isEmpty()) { + while (len - total > 0) { + const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total); + memcpy(data + total, m_buffer.constData() + m_pos, chunk); + m_pos = (m_pos + chunk) % m_buffer.size(); + total += chunk; + } } return total; } diff --git a/examples/multimedia/video/doc/src/qmlvideofx.qdoc b/examples/multimedia/video/doc/src/qmlvideofx.qdoc index edbd369c0..b24114084 100644 --- a/examples/multimedia/video/doc/src/qmlvideofx.qdoc +++ b/examples/multimedia/video/doc/src/qmlvideofx.qdoc @@ -181,8 +181,7 @@ that the divider should be displayed. The main.qml file shows a \l{video/qmlvideofx/qml/qmlvideofx/FileOpen.qml}{FileOpen}, which allows -the user to select the input source and an -\l{video/qmlvideofx/qml/qmlvideofx/EffectSelectionPanel.qml}{EffectSelectionPanel} +the user to select the input source and an EffectSelectionPanel item, which lists each of the available shader effects. As described above, a \l{video/qmlvideofx/qml/qmlvideofx/Content.qml}{Content} item is used to load the appropriate input and effect type. A |