]> git.sesse.net Git - kdenlive/blobdiff - src/renderer.cpp
First draft for keyframes in frei0r effects
[kdenlive] / src / renderer.cpp
index 0ece7e18ab0ff30ccb7f6e9ee04c0e1d746b0233..2744f6619f57fd19282b2572ca417e86bd1926b7 100644 (file)
@@ -148,7 +148,6 @@ void Render::closeMlt()
     //delete m_osdInfo;
 }
 
-
 void Render::buildConsumer(const QString profileName)
 {
     char *tmp;
@@ -2624,7 +2623,7 @@ bool Render::mltResizeClipEnd(ItemInfo info, GenTime clipDuration)
                 kDebug() << "/// RESIZE ERROR, NXT CLIP IS NOT BLK: " << clipIndex;
             }
         }
-    } else trackPlaylist.insert_blank(clipIndex, 0 - diff - 1);
+    } else if (clipIndex != trackPlaylist.count()) trackPlaylist.insert_blank(clipIndex, 0 - diff - 1);
     trackPlaylist.consolidate_blanks(0);
     mlt_service_unlock(service.get_service());
 
@@ -2857,7 +2856,7 @@ bool Render::mltMoveClip(int startTrack, int endTrack, int moveStart, int moveEn
                 m_isBlocked--;
                 return false;
             }
-            trackPlaylist.consolidate_blanks(1);
+            trackPlaylist.consolidate_blanks(0);
             destTrackPlaylist.consolidate_blanks(1);
             Mlt::Producer *clip;
             // check if we are moving a slowmotion producer
@@ -2880,8 +2879,8 @@ bool Render::mltMoveClip(int startTrack, int endTrack, int moveStart, int moveEn
 
             if (overwrite) {
                 destTrackPlaylist.remove_region(moveEnd, clip->get_playtime());
-                int clipIndex = trackPlaylist.get_clip_index_at(moveEnd);
-                trackPlaylist.insert_blank(clipIndex, clip->get_playtime() - 1);
+                int clipIndex = destTrackPlaylist.get_clip_index_at(moveEnd);
+                destTrackPlaylist.insert_blank(clipIndex, clip->get_playtime() - 1);
             }
 
             int newIndex = destTrackPlaylist.insert_at(moveEnd, clip, 1);
@@ -3502,7 +3501,13 @@ void Render::mltDeleteTrack(int ix)
             int a_track = mappedProps.value("a_track").toInt();
             int b_track = mappedProps.value("b_track").toInt();
             if (a_track > 0 && a_track >= ix) a_track --;
-            if (b_track > 0 && b_track >= ix) b_track --;
+            if (b_track > 0 && b_track > ix) b_track --;
+            if (b_track == ix) {
+                // transition was on the deleted track, so remove it
+                tractor.removeChild(transitions.at(i));
+                i--;
+                continue;
+            }
             for (int j = 0; j < props.count(); j++) {
                 QDomElement f = props.at(j).toElement();
                 if (f.attribute("name") == "a_track") f.firstChild().setNodeValue(QString::number(a_track));