From: Good Guy Date: Sat, 15 Dec 2018 03:39:36 +0000 (-0700) Subject: fix for selected_to_clipboard unpacked copy X-Git-Tag: 2019-08~151 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=0b9b147db71b52ac26c6916569a1e407bb2651bc;p=goodguy%2Fcinelerra.git fix for selected_to_clipboard unpacked copy --- diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 1e1bd0cd..03319cfc 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -939,28 +939,28 @@ void MWindow::selected_to_clipboard(int packed) Track *new_track = 0; if( !packed ) new_track = new_edl->add_new_track(track->data_type); - int64_t startproject = 0, last_startproject = start; + int64_t startproject = 0; for( Edit *edit=track->edits->first; edit; edit=edit->next ) { if( edit->startproject < start ) continue; if( edit->startproject >= end ) break; - if( !edit->is_selected || edit->silence() ) { - if( !packed ) startproject += edit->length; - continue; - } + if( !edit->is_selected || edit->silence() ) continue; if( !new_track ) new_track = new_edl->add_new_track(track->data_type); if( new_track ) { - if( !packed && startproject > last_startproject ) { - Edit *silence = new Edit(new_edl, new_track); - silence->startproject = last_startproject; - silence->length = startproject - last_startproject; - new_track->edits->append(silence); + if( !packed ) { + int64_t edit_position = edit->startproject - start; + if( edit_position > startproject ) { + Edit *silence = new Edit(new_edl, new_track); + silence->startproject = startproject; + silence->length = edit_position - startproject; + new_track->edits->append(silence); + startproject = edit_position; + } } Edit *clip_edit = new Edit(new_edl, new_track); clip_edit->copy_from(edit); clip_edit->startproject = startproject; startproject += clip_edit->length; - last_startproject = startproject; new_track->edits->append(clip_edit); } }