From c218b65d24dce7a2273a856805f6680f7e3d842c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 12 Apr 2019 18:38:49 +0200 Subject: [PATCH] Fix the URI handling (for sfdb) for Windows This forward ports Mixbus' 4eca3dea47 without additional code to correct for old (Ardour2) URIs. A2, used path2uri() which accumulated and left duplicate slashes in place, eg. "file:////". Mixbus3 auto-corrected this on load in AudioLibrary::search_members_and(). However sfdb libraries are not shared between major versions, so this code does no need to be forward ported. --- libs/ardour/audio_library.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc index 4d78bdac86..f19f8a7e98 100644 --- a/libs/ardour/audio_library.cc +++ b/libs/ardour/audio_library.cc @@ -78,8 +78,13 @@ void AudioLibrary::save_changes () { #ifdef HAVE_LRDF - if (lrdf_export_by_source(src.c_str(), src.substr(5).c_str())) { - PBD::warning << string_compose(_("Could not open %1. Audio Library not saved"), src) << endmsg; +#ifdef PLATFORM_WINDOWS + string path = Glib::locale_from_utf8 (Glib::filename_from_uri(src)); +#else + string path = Glib::filename_from_uri(src); +#endif + if (lrdf_export_by_source(src.c_str(), path.c_str())) { + PBD::warning << string_compose(_("Could not open %1. Audio Library not saved"), path) << endmsg; } #endif }