RegionReadLock rlock (const_cast<Playlist*> (this));
for (set<boost::shared_ptr<Region> >::const_iterator r = all_regions.begin(); r != all_regions.end(); ++r) {
- if ((*r)->uses_source (src, true)) {
+ /* Note: passing the second argument as false can cause at best
+ incredibly deep and time-consuming recursion, and at worst
+ cycles if the user has managed to create cycles of reference
+ between compound regions. We generally only this during
+ cleanup, and @param shallow is passed as true.
+ */
+ if ((*r)->uses_source (src, shallow)) {
return true;
}
}
if (ps) {
if (sources.find (ps) == sources.end()) {
+ /* (Playlist)Source not currently in
+ accumulating set, so recurse.
+ */
ps->playlist()->deep_sources (sources);
- cerr << ps->name() << " new source\n";
- } else {
- cerr << ps->name() << " already in source list\n";
}
}
+ /* add this source */
sources.insert (*i);
- cerr << "Added src " << (*i)->name() << endl;
}
for (SourceList::const_iterator i = _master_sources.begin(); i != _master_sources.end(); ++i) {
if (ps) {
if (sources.find (ps) == sources.end()) {
+ /* (Playlist)Source not currently in
+ accumulating set, so recurse.
+ */
ps->playlist()->deep_sources (sources);
- cerr << ps->name() << " new source2\n";
- } else {
- cerr << ps->name() << " already in source list2\n";
}
}
+ /* add this source */
sources.insert (*i);
- cerr << "Added master src " << (*i)->name() << endl;
}
}
}
}
-
void
SessionPlaylists::find_equivalent_playlist_regions (boost::shared_ptr<Region> region, vector<boost::shared_ptr<Region> >& result)
{
{
uint32_t count = 0;
- cerr << "\t\tcheck " << playlists.size() << " playlists\n";
+ /* XXXX this can go wildly wrong in the presence of circular references
+ * between compound regions.
+ */
+
for (List::const_iterator p = playlists.begin(); p != playlists.end(); ++p) {
if ((*p)->uses_source (src)) {
++count;
}
}
- cerr << "\t\tcheck " << playlists.size() << " unused playlists\n";
for (List::const_iterator p = unused_playlists.begin(); p != unused_playlists.end(); ++p) {
if ((*p)->uses_source (src)) {
++count;
}
}
}
-