diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-28 06:35:33 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-28 06:35:33 +0100 |
commit | a4851954536bb7706fbf25fcf44242cd5454b5fd (patch) | |
tree | 3dbed498b45cb8275c6fbda85379db27a8bda7cc /libs/ardour/playlist.cc | |
parent | 016eaddad72a369022d1f7f29ecbbbed17bef3f5 (diff) |
Ensure that regions have sources when saving
Otherwise this will lead to a corrupt state:
ERROR: Session: XMLNode describing a AudioRegion references an unknown source id
ERROR: Session: cannot create Region from XML description. Can not load state for region
ERROR: Playlist: cannot create region from XML
and a track without playlist is created, resulting in a later crash.
Eventually SessionPlaylists::load() needs to handle this gracefully,
but this should help catch cases causing the actual issue.
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r-- | libs/ardour/playlist.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 3508eaf0b3..2d89e9f44d 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -2409,6 +2409,7 @@ Playlist::state (bool full_state) node->set_property ("combine-ops", _combine_ops); for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) { + assert ((*i)->sources().size() > 0 && (*i)->master_sources().size() > 0); node->add_child_nocopy ((*i)->get_state()); } } |