+
+ GenTime oldDuration = GenTime(clipLength, m_fps);
+ GenTime newDuration = oldDuration * oldspeed / speed;
+
+ // Check that the blank space is long enough for our new duration
+ clipIndex = trackPlaylist.get_clip_index_at(startPos);
+ int blankEnd = trackPlaylist.clip_start(clipIndex) + trackPlaylist.clip_length(clipIndex);
+
+ Mlt::Producer *cut;
+ if (clipIndex + 1 < trackPlaylist.count() && (info.startPos + newDuration).frames(m_fps) > blankEnd) {
+ GenTime maxLength = GenTime(blankEnd, m_fps) - info.startPos;
+ cut = slowprod->cut((int)(info.cropStart.frames(m_fps)), (int)(info.cropStart.frames(m_fps) + maxLength.frames(m_fps) - 1));
+ } else cut = slowprod->cut((int)(info.cropStart.frames(m_fps) / speed), (int)((info.cropStart / speed + newDuration).frames(m_fps) - 1));
+
+ trackPlaylist.insert_at(startPos, *cut, 1);
+ clipIndex = trackPlaylist.get_clip_index_at(startPos);
+ newLength = trackPlaylist.clip_length(clipIndex);
+