diff options
author | Robin Gareus <robin@gareus.org> | 2015-07-27 17:11:35 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-07-27 17:11:52 +0200 |
commit | 22bc62ed4360aaea29c131cc7dead87fa25ef228 (patch) | |
tree | b2073c69301a4e09027fc0ce5bdbf083a0f5caa5 /libs/ardour/lv2_plugin.cc | |
parent | c55b659f391fba74704c474d7948a3976057c92a (diff) |
debug/fix LV2 state loading on OSX 10.5/PPC
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 243312f95b..c12e4930d5 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1624,10 +1624,24 @@ LV2Plugin::set_state(const XMLNode& node, int version) plugin_dir(), Glib::build_filename(prop->value(), "state.ttl")); - LilvState* state = lilv_state_new_from_file( - _world.world, _uri_map.urid_map(), NULL, state_file.c_str()); + if (!Glib::file_test (state_file, Glib::FileTest (Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR))) { + /* this should be done in lilv_state_new_from_file() + * some systems don't like realpath() calls with an non-existent file. + * (hopefully this fixes crashes on OSX 10.5/PPC, see #6456, + * segfault in __asm realpath$DARWIN_EXTSN + * if so, backport upstream to liblilv) + */ + error << string_compose( + "LV2: expected state file \"%1\" does not exist.", + state_file) << endmsg; + } else { - lilv_state_restore(state, _impl->instance, NULL, NULL, 0, NULL); + LilvState* state = lilv_state_new_from_file( + _world.world, _uri_map.urid_map(), NULL, state_file.c_str()); + + // lilv_state_restore allows/ignores possible NULL state + lilv_state_restore(state, _impl->instance, NULL, NULL, 0, NULL); + } } latency_compute_run(); |