From 7c69b0ab8228a8aeae1185ccfca7d567e5e06306 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 5 Feb 2014 18:49:32 +0100 Subject: add debug-message to track down missing Sources --- libs/ardour/session_state.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libs/ardour/session_state.cc') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index f3ad9d66dd..1728c11244 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -979,9 +979,19 @@ Session::state (bool full_state) if (!fs->destructive()) { if (fs->empty() && !fs->used()) { +#ifndef NDEBUG + cerr << "DEBUG: source '" + << fs->name() << "' id: " + << fs->id() << " is marked as empty and unused and is not saved.\n"; +#endif continue; } } +#ifndef NDEBUG + cerr << "DEBUG: saving source '" + << fs->name() << "' id: " + << fs->id() << ".\n"; +#endif child->add_child_nocopy (siter->second->get_state()); } -- cgit v1.2.3 From 60a9213035d3c9b8e17686778c70d91aa6acd356 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Feb 2014 13:38:15 -0500 Subject: fix utter confusion about session _path in new sessions. Yikes! --- libs/ardour/session_state.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'libs/ardour/session_state.cc') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 1728c11244..6d535b8e59 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -136,13 +136,21 @@ Session::pre_engine_init (string fullpath) /* discover canonical fullpath */ char buf[PATH_MAX+1]; - if (!realpath (fullpath.c_str(), buf) && (errno != ENOENT)) { - error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg; - destroy (); - throw failed_constructor(); - } - _path = string(buf); + if (!realpath (fullpath.c_str(), buf)) { + if (errno == ENOENT) { + /* fullpath does not exist yet, so realpath() returned + * ENOENT. Just use it as-is + */ + _path = fullpath; + } else { + error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg; + destroy (); + throw failed_constructor(); + } + } else { + _path = string(buf); + } /* we require _path to end with a dir separator */ -- cgit v1.2.3 From d47fe167e3c1dc44e4114227b0e8b83b40b35169 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Feb 2014 17:38:42 -0500 Subject: when cleaning up sources, do not remove "stub" sources from the source list, even though they do not exist on disk yet; remove some debug output --- libs/ardour/session_state.cc | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'libs/ardour/session_state.cc') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 6d535b8e59..ffbe55afbf 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -987,19 +987,9 @@ Session::state (bool full_state) if (!fs->destructive()) { if (fs->empty() && !fs->used()) { -#ifndef NDEBUG - cerr << "DEBUG: source '" - << fs->name() << "' id: " - << fs->id() << " is marked as empty and unused and is not saved.\n"; -#endif continue; } } -#ifndef NDEBUG - cerr << "DEBUG: saving source '" - << fs->name() << "' id: " - << fs->id() << ".\n"; -#endif child->add_child_nocopy (siter->second->get_state()); } @@ -2710,19 +2700,23 @@ Session::cleanup_sources (CleanupReport& rep) ++tmp; if ((fs = boost::dynamic_pointer_cast (i->second)) != 0) { - if (playlists->source_use_count (fs) != 0) { - all_sources.insert (fs->path()); - } else { - /* we might not remove this source from disk, because it may be used - by other snapshots, but its not being used in this version - so lets get rid of it now, along with any representative regions - in the region list. - */ + if (!fs->is_stub()) { - RegionFactory::remove_regions_using_source (i->second); - sources.erase (i); - } + if (playlists->source_use_count (fs) != 0) { + all_sources.insert (fs->path()); + } else { + + /* we might not remove this source from disk, because it may be used + by other snapshots, but its not being used in this version + so lets get rid of it now, along with any representative regions + in the region list. + */ + + RegionFactory::remove_regions_using_source (i->second); + sources.erase (i); + } + } } i = tmp; -- cgit v1.2.3