when cleaning up sources, do not remove "stub" sources from the source list, even...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 7 Feb 2014 22:38:42 +0000 (17:38 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 7 Feb 2014 22:38:42 +0000 (17:38 -0500)
libs/ardour/session_state.cc

index 6d535b8e59b75a82c7f2cd7199ce256b7726d0cf..ffbe55afbf7184d250e8dd1b7c26a53d74aa9e1b 100644 (file)
@@ -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<FileSource> (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;