fix crash at session close/exit if a midi-control-surface is used
[ardour.git] / libs / ardour / filter.cc
index b085ec946b3d09305d52b3b8871e8a05a29f1e30..b723de1e56508af42ada0c7c7932e477bf0d4d32 100644 (file)
@@ -59,10 +59,9 @@ Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, s
                        }
                }
 
-               string path = session.path_from_region_name (region->data_type(),
-                               PBD::basename_nosuffix (names[i]), string (""));
+               string path = session.new_audio_source_path (name, region->n_channels(), i, false, false);
 
-               if (path.length() == 0) {
+               if (path.empty()) {
                        error << string_compose (_("filter: error creating name for new file based on %1"), region->name())
                              << endmsg;
                        return -1;