From c9b47933501604cf2ec779bd767ff5dd6a33fcb0 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 27 Jun 2014 14:49:13 +0200 Subject: Doc: link errors Task-number: QTBUG-34749 Change-Id: I1d107a8700e03ac550fd6611d80a985a36558b22 Reviewed-by: Martin Smith --- examples/multimedia/video/doc/src/qmlvideofx.qdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples') 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 -- cgit v1.2.3 From 382d4c873a53e02f7b7c1b30218aef5c9b6175cb Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 12 Jun 2014 18:57:54 +0200 Subject: Fix AudioOutput example when no audio devices are available. Don't try to generate audio data with an invalid QAudioFormat, which can happen when no audio devices are available. Change-Id: I4de82dbf64def55fee21cf63ef99888a8084bd95 Reviewed-by: Christian Stromme --- examples/multimedia/audiooutput/audiooutput.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'examples') 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; } -- cgit v1.2.3