]> git.sesse.net Git - kdenlive/commitdiff
Fix name of dvgrab captured file:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 7 Oct 2011 10:22:47 +0000 (10:22 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 7 Oct 2011 10:22:47 +0000 (10:22 +0000)
http://kdenlive.org/mantis/view.php?id=2344

svn path=/trunk/kdenlive/; revision=5947

src/recmonitor.cpp

index a4708047d9d1553bb54f5227620d784b3a81c21c..6330474c6a5508329b7b8990f9e3a05dd4310569 100644 (file)
@@ -830,7 +830,19 @@ void RecMonitor::manageCapturedFiles()
         KUrl url = KUrl(dir.filePath(name));
         if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) {
             KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
-            if (file.time(KFileItem::ModificationTime) > m_captureTime) capturedFiles.append(url);
+            if (file.time(KFileItem::ModificationTime) > m_captureTime) {
+                // The file was captured in the last batch
+                if (url.fileName().contains(':')) {
+                    // Several dvgrab options (--timecode,...) use : in the file name, which is
+                    // not supported by MLT, so rename them
+                    QString newUrl = url.directory(KUrl::AppendTrailingSlash) + url.fileName().replace(':', '_');
+                    if (QFile::rename(url.path(), newUrl)) {
+                        url = KUrl(newUrl);
+                    }
+                    
+                }
+                capturedFiles.append(url);
+            }
         }
     }
     kDebug() << "Found : " << capturedFiles.count() << " new capture files";