[vlc-commits] modules: check deactivation callback type

Rémi Denis-Courmont git at videolan.org
Thu Jul 25 18:52:55 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 24 22:22:42 2019 +0300| [efcc9a94c6eb03b98fe9b020b45f58db34a82554] | committer: Rémi Denis-Courmont

modules: check deactivation callback type

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=efcc9a94c6eb03b98fe9b020b45f58db34a82554
---

 include/vlc_plugin.h |  2 +-
 src/modules/entry.c  | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index bd06aa224d..2ddc6cb0b1 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -314,7 +314,7 @@ VLC_METADATA_EXPORTS
 #define set_callbacks( activate, deactivate ) \
     set_callback(activate) \
     if (vlc_module_set(VLC_MODULE_CB_CLOSE, #deactivate, \
-                       (void *)(deactivate))) \
+                       (void (*)(vlc_object_t *)){ deactivate })) \
         goto error;
 
 #define cannot_unload_broken_library( ) \
diff --git a/src/modules/entry.c b/src/modules/entry.c
index 52326386e2..c3e64af3d3 100644
--- a/src/modules/entry.c
+++ b/src/modules/entry.c
@@ -274,7 +274,7 @@ static int vlc_plugin_desc_cb(void *ctx, void *tgt, int propid, ...)
 
         case VLC_MODULE_CB_CLOSE:
             module->deactivate_name = va_arg(ap, const char *);
-            module->deactivate = va_arg (ap, void *);
+            module->deactivate = va_arg(ap, void (*)(vlc_object_t *));
             break;
 
         case VLC_MODULE_NO_UNLOAD:
@@ -493,6 +493,16 @@ static int vlc_plugin_gpa_cb(void *ctx, void *tgt, int propid, ...)
             va_end (ap);
             break;
         }
+        case VLC_MODULE_CB_CLOSE:
+        {
+            va_list ap;
+
+            va_start(ap, propid);
+            name = va_arg(ap, const char *);
+            addr = va_arg(ap, void (*)(vlc_object_t *));
+            va_end(ap);
+            break;
+        }
         default:
             return 0;
     }



More information about the vlc-commits mailing list