[vlc-commits] modules: expect a logger in module_Map()
Rémi Denis-Courmont
git at videolan.org
Mon Mar 4 21:05:55 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 4 20:37:49 2019 +0200| [90f46791015f9fcf278c7a1f9bbab59d086701ed] | committer: Rémi Denis-Courmont
modules: expect a logger in module_Map()
No variables were harmed in the loading of a shared object.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=90f46791015f9fcf278c7a1f9bbab59d086701ed
---
src/modules/bank.c | 9 +++++----
src/modules/modules.c | 2 +-
src/modules/modules.h | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/modules/bank.c b/src/modules/bank.c
index a67c338a8b..a63221318b 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -497,7 +497,7 @@ static void AllocateAllPlugins (vlc_object_t *p_this)
*
* \return 0 on success, -1 on failure
*/
-int module_Map(vlc_object_t *obj, vlc_plugin_t *plugin)
+int module_Map(struct vlc_logger *log, vlc_plugin_t *plugin)
{
static vlc_mutex_t lock = VLC_STATIC_MUTEX;
@@ -511,8 +511,8 @@ int module_Map(vlc_object_t *obj, vlc_plugin_t *plugin)
if (handle == NULL)
{
char *errmsg = vlc_dlerror();
- msg_Err(obj, "cannot load plug-in %s: %s", plugin->abspath,
- errmsg ? errmsg : "unknown error");
+ vlc_error(log, "cannot load plug-in %s: %s",
+ plugin->abspath, errmsg ? errmsg : "unknown error");
free(errmsg);
return -1;
}
@@ -520,7 +520,8 @@ int module_Map(vlc_object_t *obj, vlc_plugin_t *plugin)
vlc_plugin_cb entry = vlc_dlsym(handle, vlc_entry_name);
if (entry == NULL)
{
- msg_Err(obj, "cannot find plug-in entry point in %s", plugin->abspath);
+ vlc_error(log, "cannot find plug-in entry point in %s",
+ plugin->abspath);
goto error;
}
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 4b26453855..a7b59ad4c0 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -156,7 +156,7 @@ static int module_load (vlc_object_t *obj, module_t *m,
{
int ret = VLC_SUCCESS;
- if (module_Map(obj, m->plugin))
+ if (module_Map(obj->obj.logger, m->plugin))
return VLC_EGENERIC;
if (m->pf_activate != NULL)
diff --git a/src/modules/modules.h b/src/modules/modules.h
index 907b7a573e..1c7d32e8e5 100644
--- a/src/modules/modules.h
+++ b/src/modules/modules.h
@@ -110,7 +110,7 @@ void module_InitBank (void);
void module_LoadPlugins(vlc_object_t *);
#define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
void module_EndBank (bool);
-int module_Map(vlc_object_t *, vlc_plugin_t *);
+int module_Map(struct vlc_logger *, vlc_plugin_t *);
ssize_t module_list_cap (module_t ***, const char *);
More information about the vlc-commits
mailing list