]> git.sesse.net Git - kdenlive/blobdiff - src/renderer.cpp
Improve handling of missing clips:
[kdenlive] / src / renderer.cpp
index 68b522b4774aaf5b4774f5061c5b1a398a1657ef..110f4122c6fa6713b054e7b6905e19e4e048edb2 100644 (file)
@@ -519,7 +519,7 @@ void Render::getFileProperties(const QDomElement &xml, const QString &clipId, bo
 
     if (producer == NULL || producer->is_blank() || !producer->is_valid()) {
         kDebug() << " / / / / / / / / ERROR / / / / // CANNOT LOAD PRODUCER: ";
-        emit removeInvalidClip(clipId);
+        emit removeInvalidClip(clipId, replaceProducer);
         delete producer;
         return;
     }
@@ -828,11 +828,13 @@ void Render::setSceneList(QString playlist, int position)
     blockSignals(true);
     char *tmp = decodedString(playlist);
     m_mltProducer = new Mlt::Producer(*m_mltProfile, "westley-xml", tmp);
-    delete[] tmp;
 
     if (!m_mltProducer || !m_mltProducer->is_valid()) {
         kDebug() << " WARNING - - - - -INVALID PLAYLIST: " << tmp;
+        m_mltProducer = m_blackClip->cut(0, 50);
     }
+    delete[] tmp;
+
     m_mltProducer->optimise();
 
     /*if (KdenliveSettings::osdtimecode()) {
@@ -1455,7 +1457,8 @@ void Render::mltCutClip(int track, GenTime position)
     int ct = 0;
     Mlt::Filter *filter = clipService.filter(ct);
     while (filter) {
-        if (filter->is_valid() && strcmp(filter->get("kdenlive_id"), "")) {
+        // Only duplicate Kdenlive filters, and skip the fade in effects
+        if (filter->is_valid() && strcmp(filter->get("kdenlive_id"), "") && strcmp(filter->get("kdenlive_id"), "fadein") && strcmp(filter->get("kdenlive_id"), "fade_from_black")) {
             // looks like there is no easy way to duplicate a filter,
             // so we will create a new one and duplicate its properties
             Mlt::Filter *dup = new Mlt::Filter(*m_mltProfile, filter->get("mlt_service"));
@@ -2927,9 +2930,13 @@ void Render::mltInsertTrack(int ix, bool videoTrack)
 
     Mlt::Tractor tractor(service);
 
-    Mlt::Playlist playlist;// = new Mlt::Playlist();
+    Mlt::Playlist playlist;
     int ct = tractor.count();
-    // kDebug() << "// TRACK INSERT: " << ix << ", MAX: " << ct;
+    if (ix > ct) {
+        kDebug() << "// ERROR, TRYING TO insert TRACK " << ix << ", max: " << ct;
+        ix = ct;
+    }
+
     int pos = ix;
     if (pos < ct) {
         Mlt::Producer *prodToMove = new Mlt::Producer(tractor.track(pos));