Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue audacity#2226: Joining multiple clips sometimes time-shifts them
Steps to reproduce: 1. Split an audio clip into three clips 2. Move the clips so that there are spaces between the clips. 3. Select all the audio (Ctrl+A) 4. Join the clips (Ctrl+J) 5. Observe that clips are not joined correctly. Problem: In WaveClip::InsertSilence(), the following two lines: else if (t == GetPlayEndTime() && t < GetSequenceEndTime()) ClearSequence(t, GetSequenceEndTime()); After ClearSequence is called to remove the data to the end of the sequence, then there is not call to update mTrimRight, as is done in WaveClip::ClearRight(). So when more data is pasted, it's pasted in the wrong place. Fix: Update mTrimeRight. Notes: 1. I don't know why the bug was not always reproduceable. 2. There appears to be a similar issue with the previous two lines: if (t == GetPlayStartTime() && t > GetSequenceStartTime()) ClearSequence(GetSequenceStartTime(), t); Compare with WaveClip::ClearLeft(). However I have left that unfixed, both because it doesn't affect this bug, and also because I couldn't work out when that call to ClearSequence would get called, and so I couldn't test any fix.
- Loading branch information