summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2016-07-10 20:42:42 +0200
committerStefan Sauer <ensonic@users.sf.net>2016-07-10 20:44:19 +0200
commit13d963fbf0223910cff55dae1f2bd0b653b19394 (patch)
tree8630858f1d03fa1041aca32c86adb738c372b6a7
parentdae928f14c5ca4a344c3a1b793383fb70720936f (diff)
downloadgstreamer-plugins-bad-13d963fbf0223910cff55dae1f2bd0b653b19394.tar.gz
lv2: keep working with older versions
Provide a fallback impl. for the only new function we were using from 0.22. Fixes #768595
-rw-r--r--configure.ac8
-rw-r--r--ext/lv2/gstlv2utils.c22
2 files changed, 27 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 502fb2e36..573d3bdfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2361,7 +2361,13 @@ AG_GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
dnl *** LV2 ***
translit(dnm, m, l) AM_CONDITIONAL(USE_LV2, true)
AG_GST_CHECK_FEATURE(LV2, [lv2], lv2, [
- PKG_CHECK_MODULES(LILV, lilv-0 >= 0.6.6, HAVE_LV2="yes", HAVE_LV2="no")
+ PKG_CHECK_MODULES(LILV, lilv-0 >= 0.22, [
+ HAVE_LV2="yes",
+ HAVE_LILV_0_22="yes"
+ AC_DEFINE(HAVE_LILV_0_22, 1, [Define if we have liblilv >= 0.22])
+ ],[
+ PKG_CHECK_MODULES(LILV, lilv-0 >= 0.16, HAVE_LV2="yes", HAVE_LV2="no")
+ ])
AC_SUBST(LILV_CFLAGS)
AC_SUBST(LILV_LIBS)
])
diff --git a/ext/lv2/gstlv2utils.c b/ext/lv2/gstlv2utils.c
index 017d449fe..577dc858f 100644
--- a/ext/lv2/gstlv2utils.c
+++ b/ext/lv2/gstlv2utils.c
@@ -272,8 +272,12 @@ gst_lv2_save_preset (GstLV2 * lv2, GstObject * obj, const gchar * name)
GstElementFactory *factory;
LilvState *state;
LilvNode *bundle_dir;
+ const LilvNode *state_uri;
LilvInstance *instance = lv2->instance;
gboolean res;
+#ifndef HAVE_LILV_0_22
+ gchar *filepath;
+#endif
factory = gst_element_get_factory ((GstElement *) obj);
basename = g_strdup (gst_element_factory_get_metadata (factory,
@@ -313,9 +317,19 @@ gst_lv2_save_preset (GstLV2 * lv2, GstObject * obj, const gchar * name)
lilv_world_load_bundle (world, bundle_dir);
lilv_node_free (bundle_dir);
- lilv_world_load_resource (world, lilv_state_get_uri (state));
+#ifdef HAVE_LILV_0_22
+ state_uri = lilv_state_get_uri (state);
+#else
+ filepath = g_build_filename (dir, filename, NULL);
+ state_uri = lilv_new_uri (world, filepath);
+#endif
+ lilv_world_load_resource (world, state_uri);
g_hash_table_insert (lv2->presets, g_strdup (name),
- lilv_node_duplicate (lilv_state_get_uri (state)));
+ lilv_node_duplicate (state_uri));
+#ifndef HAVE_LILV_0_22
+ g_free (filepath);
+ lilv_node_free ((LilvNode *) state_uri);
+#endif
lilv_state_free (state);
if (!lv2->instance) {
@@ -757,12 +771,16 @@ gst_lv2_element_class_set_metadata (GstLV2Class * lv2_class,
}
val = lilv_plugin_get_author_name (lv2plugin);
if (val) {
+ // TODO: check lilv_plugin_get_author_email(lv2plugin);
author = g_strdup (lilv_node_as_string (val));
lilv_node_free (val);
} else {
author = g_strdup ("no author available");
}
+ // TODO: better description from:
+ // lilv_plugin_get_author_homepage() and lilv_plugin_get_project()
+
lv2plugin_class = lilv_plugin_get_class (lv2plugin);
cval = lilv_plugin_class_get_label (lv2plugin_class);
if (cval) {