diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 1626f33df0..8bdf1b558a 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -1513,6 +1513,9 @@ gst_plugin_ext_dep_direntry_matches (GstPlugin * plugin, const gchar * entry, if (((flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX)) && g_str_has_suffix (entry, *filenames)) { return TRUE; + } else if (((flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX)) && + g_str_has_prefix (entry, *filenames)) { + return TRUE; /* else it's an exact match that's needed */ } else if (strcmp (entry, *filenames) == 0) { return TRUE; @@ -1589,7 +1592,7 @@ gst_plugin_ext_dep_scan_path_with_filenames (GstPlugin * plugin, GstPluginDependencyFlags flags) { const gchar *empty_filenames[] = { "", NULL }; - gboolean recurse_into_dirs, partial_names; + gboolean recurse_into_dirs, partial_names = FALSE; guint i, hash = 0; /* to avoid special-casing below (FIXME?) */ @@ -1597,7 +1600,10 @@ gst_plugin_ext_dep_scan_path_with_filenames (GstPlugin * plugin, filenames = empty_filenames; recurse_into_dirs = ! !(flags & GST_PLUGIN_DEPENDENCY_FLAG_RECURSE); - partial_names = ! !(flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX); + + if ((flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX) || + (flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX)) + partial_names = TRUE; /* if we can construct the exact paths to check with the data we have, just * stat them one by one; this is more efficient than opening the directory diff --git a/gst/gstplugin.h b/gst/gstplugin.h index c76302fb3b..ff6041f775 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -93,6 +93,9 @@ typedef enum * @GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX : interpret * filename argument as filter suffix and check all matching files in * the directory + * @GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX : interpret + * filename argument as filter prefix and check all matching files in + * the directory. Since 1.8. * * Flags used in connection with gst_plugin_add_dependency(). */ @@ -100,7 +103,8 @@ typedef enum { GST_PLUGIN_DEPENDENCY_FLAG_NONE = 0, GST_PLUGIN_DEPENDENCY_FLAG_RECURSE = (1 << 0), GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY = (1 << 1), - GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX = (1 << 2) + GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX = (1 << 2), + GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX = (1 << 3) } GstPluginDependencyFlags; /**