summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/file_source.cc6
-rw-r--r--libs/ardour/session.cc8
2 files changed, 9 insertions, 5 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index a7e3585e64..fd3e9ef142 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -122,11 +122,7 @@ FileSource::init (const string& pathstr, bool must_exist)
}
set_within_session_from_path (_path);
-
- if (!within_session()) {
- _session.ensure_search_path_includes (Glib::path_get_dirname (_path), _type);
- }
-
+
_name = Glib::path_get_basename (_path);
if (_file_is_new && must_exist) {
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index b09d67fb35..37d4d2908f 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -2952,6 +2952,14 @@ Session::add_source (boost::shared_ptr<Source> source)
/* yay, new source */
+ boost::shared_ptr<FileSource> fs = boost::dynamic_pointer_cast<FileSource> (source);
+
+ if (fs) {
+ if (!fs->within_session()) {
+ ensure_search_path_includes (Glib::path_get_dirname (fs->path()), fs->type());
+ }
+ }
+
set_dirty();
boost::shared_ptr<AudioFileSource> afs;