]> git.sesse.net Git - kdenlive/commitdiff
small cleanup in proxy path handling
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 31 May 2011 21:31:50 +0000 (21:31 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 31 May 2011 21:31:50 +0000 (21:31 +0000)
svn path=/trunk/kdenlive/; revision=5627

src/mainwindow.cpp
src/projectlist.cpp

index 7d2dc98745a1c8fcf9de94706795b41c3f66708f..8346a8e0544eb9bad6c117b0c390f0598dc40b09 100644 (file)
@@ -3837,7 +3837,6 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
         // replace proxy clips with originals
         QMap <QString, QString> proxies = m_projectList->getProxies();
 
-
         QDomNodeList producers = doc.elementsByTagName("producer");
         QString producerResource;
         QString suffix;
@@ -3846,7 +3845,7 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
             producerResource = EffectsList::property(e, "resource");
             if (producerResource.isEmpty()) continue;
             if (!producerResource.startsWith("/")) {
-                producerResource = root + "/" + producerResource;
+                producerResource.prepend(root + "/");
             }
             if (producerResource.contains('?')) {
                 // slowmotion producer
@@ -3861,12 +3860,6 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
                     // sometimes have different ratio than original clips
                     EffectsList::removeProperty(e, "aspect_ratio");
                 }
-                else if (!root.isEmpty() && producerResource.startsWith(root) && proxies.contains(producerResource.remove(0, root.count() + 1))) {
-                    EffectsList::setProperty(e, "resource", proxies.value(producerResource) + suffix);
-                    // We need to delete the "aspect_ratio" property because proxy clips
-                    // sometimes have different ratio than original clips
-                    EffectsList::removeProperty(e, "aspect_ratio");
-                }
             }
         }
         
index 1678b3150cf6c2c9a9fca5f5588ae353dea167cd..49f4f10df125180b77549668ad7c91f674c2ce97 100644 (file)
@@ -1611,10 +1611,11 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce
             else maxSize = m_doc->getDocumentProperty("proxyminsize").toInt();
             if (((t == AV || t == VIDEO) && generateProxy() && size.section('x', 0, 0).toInt() > maxSize) || (t == IMAGE && generateImageProxy() && (size.section('x', 0, 0).toInt() > maxSize || size.section('x', 1, 1).toInt() > maxSize))) {
                 if (clip->getProperty("proxy").isEmpty()) {
-                    QString proxydir = m_doc->projectFolder().path( KUrl::AddTrailingSlash) + "proxy/";
+                    KUrl proxyPath = m_doc->projectFolder();
+                    proxyPath.addPath("proxy/");
+                    proxyPath.addPath(clip->getClipHash() + "." + (t == IMAGE ? "png" : m_doc->getDocumentProperty("proxyextension")));
                     QMap <QString, QString> newProps;
-                    QString path = proxydir + clip->getClipHash() + "." + (t == IMAGE ? "png" : m_doc->getDocumentProperty("proxyextension"));
-                    newProps.insert("proxy", path);
+                    newProps.insert("proxy", proxyPath.path());
                     // insert required duration for proxy
                     if (t != IMAGE) newProps.insert("proxy_out", clip->producerProperty("out"));
                     QMap <QString, QString> oldProps = clip->properties();