Do not explicitly copy [whole-file] Region

Playlist::add_region copies regions as needed (see 8d045e15dc),
without forking the Source.

This fixes an issue when importing MIDI files. When
midi-copy-is-fork is enabled (enabled by default), the
RegionFactory::create call used during import forked the
region. This resulted in two Sources being created for each
imported MIDI file.
This commit is contained in:
Robin Gareus 2022-11-27 03:15:18 +01:00
parent 580179272d
commit abf92e42c0
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -1144,9 +1144,8 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region,
} }
} else { } else {
boost::shared_ptr<Playlist> playlist = existing_track->playlist(); boost::shared_ptr<Playlist> playlist = existing_track->playlist();
boost::shared_ptr<Region> copy (RegionFactory::create (region, true));
playlist->clear_changes (); playlist->clear_changes ();
playlist->add_region (copy, pos); playlist->add_region (region, pos);
_session->add_command (new StatefulDiffCommand (playlist)); _session->add_command (new StatefulDiffCommand (playlist));
} }
break; break;