Skip to content

Commit

Permalink
Workaround Stabilize filter crash at end of analysis on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Jun 5, 2014
1 parent da80be2 commit 130084b
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/qmltypes/qmlfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ void QmlFilter::onAnalyzeFinished(MeltJob *job, bool isSuccess)
{
QString fileName = job->objectName();

if (isSuccess) {
#if !defined(Q_OS_WIN)
// Workaround qmelt crashing on Windows at end of vidstab analysis.
if (isSuccess)
#endif
{
// parse the xml
QFile file(fileName);
file.open(QIODevice::ReadOnly);
Expand All @@ -282,8 +286,20 @@ void QmlFilter::onAnalyzeFinished(MeltJob *job, bool isSuccess)
for (int j = 0; j < properties.size(); j++) {
QDomNode propertyNode = properties.at(j);
if (propertyNode.attributes().namedItem("name").toAttr().value() == "results") {
m_filter->set("results", propertyNode.toElement().text().toLatin1().constData());
m_filter->set("results", propertyNode.toElement().text().toUtf8().constData());
}
#if defined(Q_OS_WIN)
// Workaround for qmelt crashing on Windows at end of vidstab analysis.
// The .stab file contents may still be valid; copy filename to results.
else if (!isSuccess && propertyNode.attributes().namedItem("name").toAttr().value() == "filename") {
if (get("mlt_service") == "vidstab") {
const QString& filePath = propertyNode.toElement().text();
QFileInfo info(filePath);
if (info.size() > 0)
m_filter->set("results", filePath.toUtf8().constData());
}
}
#endif
}
break;
}
Expand Down

0 comments on commit 130084b

Please sign in to comment.