]> git.sesse.net Git - kdenlive/commitdiff
Fix timeline corruption when resizing color or title clips:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 27 Aug 2010 04:32:29 +0000 (04:32 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 27 Aug 2010 04:32:29 +0000 (04:32 +0000)
http://www.kdenlive.org/mantis/view.php?id=1767

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

src/renderer.cpp

index f3002a87bfcb05817038026377fb0e6a7c92f157..64b355e998b2183f39fd94bf6717ba3fafdf2183 100644 (file)
@@ -2877,16 +2877,17 @@ bool Render::mltResizeClipEnd(ItemInfo info, GenTime clipDuration)
     Mlt::Producer *clip = trackPlaylist.get_clip(clipIndex);
     int previousStart = clip->get_in();
     int newDuration = (int) clipDuration.frames(m_fps) - 1;
+    int currentOut = (int)(info.cropStart + info.cropDuration).frames(m_fps) - 1;
     int diff = newDuration - (trackPlaylist.clip_length(clipIndex) - 1);
-    if (newDuration > clip->get_length()) {
-        clip->parent().set("length", newDuration + 1);
-        clip->parent().set("out", newDuration);
-        clip->set("length", newDuration + 1);
+    if (currentOut > clip->get_length()) {
+        clip->parent().set("length", currentOut + 1);
+        clip->parent().set("out", currentOut);
+        clip->set("length", currentOut + 1);
     }
-    if (newDuration > clip->get_out()) {
+    /*if (newDuration > clip->get_out()) {
         clip->parent().set_in_and_out(0, newDuration + 1);
         clip->set_in_and_out(0, newDuration + 1);
-    }
+    }*/
     delete clip;
     trackPlaylist.resize_clip(clipIndex, previousStart, newDuration + previousStart);
     trackPlaylist.consolidate_blanks(0);