Undo "Trim clip out point" doesn't update clip

What is your operating system?
Ubuntu 22.04.2 x86-64

What is your Shotcut version (see Help > About Shotcut)?

Can you repeat the problem? If so, what are the steps?
I’m trimming the clip out point at a marker in a particular clip (in the timeline), with ripple/ripple all/ripple markers all enabled. The result is correct, but if I undo it, the clip’s out point does not revert correctly, and the next clip in the same video track is unexpectedly trimmed. The markers do update correctly back to their original positions.

I’ve experimented with this project repeatedly, and narrowed the problem down to a JPG later in the timeline (in a different video track to the clip). If I delete that JPG the undo works perfectly.

This is the starting point, before trimming. The playhead is over the marker where I perform the cut (with shift+O).

This is the state following the trim; all as expected:

Then following the undo (with ctrl+Z):

In these screenshots the JPG that seems to trigger the issue is in the top video track at 3:15.
The issue still occurs - and occurs every time - if I:

  • Delete all markers, including the cut point one.
  • Delete all clips except 220, 221 and the JPG

App log for the undo shows:
[Debug ] <Timeline::TrimClipOutCommand::undo> trackIndex 1 clipIndex 0 delta 304

I’ve saved a near-minimal version of the project so can experiment with it if any more detail required.


Some other useful bits of info:

  • if I lock the top video track that contains the JPG then the bug isn’t triggered.
  • the bug is triggered when setting either in or out cut point for either of the first 2 clips (220,221)

The bug manifests differently (or possibly different bug) if I set the in cut point for the 3rd clip (overlaid by the JPEG) and undo it: the clip reverts fine, but the audio clips aren’t reverted correctly.

Before setting cut in point at the playhead:

After setting cut in point then reverting, the first audio clip still incorrectly starts where the cut point was, and the clip after has been extended to and beyond the end of the timeline:

Thanks for your report. I have created a minimal example that demonstrates the bug.

trim_undo_bug.mlt (4.9 KB)

Using the project trim_undo_bug.mlt

  1. Enable “Ripple All Tracks”
  2. Select the red clip
  3. Place the playhead at 5:00
  4. Press SHIFT+O
  5. Press CTL+Z
  6. Observe that the red clip length was not restored

Before Trim:

After Trim:

After Undo:

This is fixed for the next release.

1 Like