summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-06-25 00:34:13 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-06-25 00:34:13 +0000
commit4bf64d7d8c11bf3e2c7bc1b8fbb6c754372b2739 (patch)
treeba62f96ae44bfecd32b4fea63a2d955010492c59 /libs/ardour
parent3488b2fe094169456a4aff2f2b021a54b2db8254 (diff)
another part of the fix for cleanup: when successfully using link(2) to embed a file in the session, make sure to store its path as a relative rather than absolute path - this way it looks like a file that actually belongs to the session
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5269 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/audiofilesource.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index ac5a6e7b8c..b506924513 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -154,7 +154,11 @@ AudioFileSource::init (ustring pathstr, bool must_exist)
timeline_position = 0;
_peaks_built = false;
- if (!find (pathstr, must_exist, is_embedded(), file_is_new, _channel, _path, _name)) {
+ /* is_embedded() can't work yet, because our _path is not set */
+
+ bool embedded = determine_embeddedness (pathstr);
+
+ if (!find (pathstr, must_exist, embedded, file_is_new, _channel, _path, _name)) {
throw non_existent_source ();
}
@@ -568,7 +572,7 @@ AudioFileSource::find (ustring pathstr, bool must_exist, bool embedded,
if (embedded) {
name = pathstr;
} else {
- name = pathstr.substr (pathstr.find_last_of ('/') + 1);
+ name = Glib::path_get_basename (pathstr);
}
if (!Glib::file_test (pathstr, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {