public void paste(MovieBox to, MovieBox from, double sec) {
TrakBox videoTrack = to.getVideoTrack();
if (videoTrack != null && videoTrack.getTimescale() != to.getTimescale())
to.fixTimescale(videoTrack.getTimescale());
long displayTv = (long) (to.getTimescale() * sec);
forceEditListMov(to);
forceEditListMov(from);
TrakBox[] fromTracks = from.getTracks();
TrakBox[] toTracks = to.getTracks();
int[][] matches = findMatches(fromTracks, toTracks);
for (int i = 0; i < matches[0].length; i++) {
TrakBox localTrack = to.importTrack(from, fromTracks[i]);
if (matches[0][i] != -1) {
insertTo(to, toTracks[matches[0][i]], localTrack, displayTv);
} else {
to.appendTrack(localTrack);
shift(to, localTrack, displayTv);
}
}
for (int i = 0; i < matches[1].length; i++) {
if (matches[1][i] == -1) {
spread(to, toTracks[i], displayTv, to.rescale(from.getDuration(), from.getTimescale()));
}
}
to.updateDuration();
}