diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-03-30 10:06:08 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-03-30 10:06:08 -0400 |
commit | 864ce8f0d1aaefdbf7cb582b9ed34d669e81c468 (patch) | |
tree | 5906db222e4df58306952272549b3362fdff5d0a | |
parent | 91a279800120319bf14c29e4c63c9c9de1cca83e (diff) |
if a filesource is supposed to be new, don't waste time looking for it. if it has its _origin member set, search for that, not its name (affects embedded files)
-rw-r--r-- | libs/ardour/file_source.cc | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc index cd39faa08e..8c207feea7 100644 --- a/libs/ardour/file_source.cc +++ b/libs/ardour/file_source.cc @@ -111,15 +111,26 @@ FileSource::init (const string& pathstr, bool must_exist) { _timeline_position = 0; - if (Stateful::loading_state_version < 3000) { - if (!find_2X (_session, _type, pathstr, must_exist, _file_is_new, _channel, _path)) { - throw MissingSource (pathstr, _type); - } - } else { - if (!find (_session, _type, pathstr, must_exist, _file_is_new, _channel, _path)) { - throw MissingSource (pathstr, _type); - } - } + if (!_file_is_new) { + + if (Stateful::loading_state_version < 3000) { + if (!find_2X (_session, _type, pathstr, must_exist, _file_is_new, _channel, _path)) { + throw MissingSource (pathstr, _type); + } + } else { + string look_for; + + if (!_origin.empty()) { + look_for = _origin; + } else { + look_for = pathstr; + } + + if (!find (_session, _type, look_for, must_exist, _file_is_new, _channel, _path)) { + throw MissingSource (pathstr, _type); + } + } + } set_within_session_from_path (_path); |