1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-12 06:01:13 +02:00

Fix some crashes in time-shift

This commit is contained in:
Paul Licameli 2018-10-04 12:02:51 -04:00
parent 92cceaf599
commit b5a7b67cb7

View File

@ -263,6 +263,7 @@ void TimeShiftHandle::CreateListOfCapturedClips
// because AddClipsToCaptured doesn't add duplicate clips); to remove
// this behavior just store the array size beforehand.
for (unsigned int i = 0; i < state.capturedClipArray.size(); ++i) {
{
auto &trackClip = state.capturedClipArray[i];
// Capture based on tracks that have clips -- that means we
// don't capture based on links to label tracks for now (until
@ -274,7 +275,11 @@ void TimeShiftHandle::CreateListOfCapturedClips
trackClip.clip->GetStartTime(),
trackClip.clip->GetEndTime() );
}
}
#ifdef USE_MIDI
{
// Beware relocation of array contents! Bind trackClip again.
auto &trackClip = state.capturedClipArray[i];
// Capture additional clips from NoteTracks
trackClip.track->TypeSwitch( [&](NoteTrack *nt) {
// Iterate over sync-lock group tracks.
@ -282,6 +287,7 @@ void TimeShiftHandle::CreateListOfCapturedClips
AddClipsToCaptured
( state, t, nt->GetStartTime(), nt->GetEndTime() );
});
}
#endif
}
}