Merge remote-tracking branch 'origin/5.3' into dev

Change-Id: I38ebcb3da0e4d2acc9e7108c9579ea98323864e0
This commit is contained in:
Frederik Gladhorn
2014-07-10 10:14:36 +02:00
15 changed files with 110 additions and 68 deletions

View File

@@ -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;
}

View File

@@ -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