+ QString resource;
+ QDomNodeList documentProducers = m_doc.elementsByTagName("producer");
+ QList <QDomElement> wrongDurationClips;
+ QList <QDomElement> missingProxies;
+ for (int i = 0; i < m_info.count(); i++) {
+ e = m_info.item(i).toElement();
+ clipType = e.attribute("type").toInt();
+ if (clipType == COLOR) continue;
+ if (clipType != TEXT && clipType != IMAGE && clipType != SLIDESHOW) {
+ QString id = e.attribute("id");
+ int duration = e.attribute("duration").toInt();
+ int mltDuration = -1;
+ // Check that the duration is in sync between Kdenlive's info and MLT's playlist
+ for (int j = 0; j < documentProducers.count(); j++) {
+ QDomElement mltProd = documentProducers.at(j).toElement();
+ QString prodId = mltProd.attribute("id");
+ // Don't check slowmotion clips for now... (TODO?)
+ if (prodId.startsWith("slowmotion")) continue;
+ if (prodId.contains("_")) prodId = prodId.section("_", 0, 0);
+ if (prodId != id) continue;
+ if (mltDuration > 0 ) {
+ // We have several MLT producers for the same clip (probably track producers)
+ int newLength = EffectsList::property(mltProd, "length").toInt();
+ if (newLength != mltDuration) {
+ // we have a different duration for the same clip, that is not safe
+ e.setAttribute("_resetDuration", 1);
+ }
+ }
+ mltDuration = EffectsList::property(mltProd, "length").toInt();
+ if (mltDuration != duration) {
+ // Duration mismatch
+ e.setAttribute("_mismatch", mltDuration);
+ if (mltDuration == 15000) {
+ // a length of 15000 might indicate a wrong clip length since it is a default length
+ e.setAttribute("_resetDuration", 1);
+ }
+ if (!wrongDurationClips.contains(e)) wrongDurationClips.append(e);
+ }
+ }
+ }
+
+ if (clipType == TEXT) {
+ //TODO: Check is clip template is missing (xmltemplate) or hash changed
+ QStringList images = TitleWidget::extractImageList(e.attribute("xmldata"));
+ QStringList fonts = TitleWidget::extractFontList(e.attribute("xmldata"));
+ checkMissingImages(images, fonts, e.attribute("id"), e.attribute("name"));
+ continue;
+ }
+ resource = e.attribute("resource");
+ if (e.hasAttribute("proxy")) {
+ QString proxyresource = e.attribute("proxy");
+ if (!proxyresource.isEmpty() && proxyresource != "-" && !KIO::NetAccess::exists(KUrl(proxyresource), KIO::NetAccess::SourceSide, 0)) {
+ // Missing clip found
+ missingProxies.append(e);
+ }
+ }
+ if (clipType == SLIDESHOW) resource = KUrl(resource).directory();
+ if (!KIO::NetAccess::exists(KUrl(resource), KIO::NetAccess::SourceSide, 0)) {
+ // Missing clip found
+ m_missingClips.append(e);
+ } else {
+ // Check if the clip has changed
+ if (clipType != SLIDESHOW && e.hasAttribute("file_hash")) {
+ if (e.attribute("file_hash") != DocClipBase::getHash(e.attribute("resource")))
+ e.removeAttribute("file_hash");
+ }
+ }
+ }
+
+ QStringList missingLumas;
+ QString root = m_doc.documentElement().attribute("root");
+ if (!root.isEmpty()) root = KUrl(root).path(KUrl::AddTrailingSlash);
+ QDomNodeList trans = m_doc.elementsByTagName("transition");
+ for (int i = 0; i < trans.count(); i++) {
+ QString luma = getProperty(trans.at(i).toElement(), "luma");
+ if (!luma.isEmpty()) {
+ QString lumaPath = luma;
+ if (!lumaPath.startsWith('/')) lumaPath.prepend(root);
+ if (!QFile::exists(lumaPath) && !missingLumas.contains(luma)) {
+ missingLumas.append(luma);
+ }
+ }
+ }