]> git.sesse.net Git - vlc/blobdiff - src/misc/probe.c
core: gather message initialization code
[vlc] / src / misc / probe.c
index 79922fa66ee0f2eb3482c63fdee3ab926c403110..498909b423ee7c454c63f1cf8939c901558829a9 100644 (file)
@@ -3,19 +3,19 @@
  *****************************************************************************
  * Copyright © 2009 Rémi Denis-Courmont
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
 
 #include <vlc_common.h>
 #include <vlc_probe.h>
+#include <vlc_modules.h>
 #include "libvlc.h"
 
 #undef vlc_probe
 void *vlc_probe (vlc_object_t *obj,
                  const char *capability, size_t *restrict pcount)
 {
-    vlc_probe_t *probe = vlc_custom_create (obj, sizeof(*probe),
-                                            VLC_OBJECT_GENERIC, "probe");
+    vlc_probe_t *probe = vlc_custom_create (obj, sizeof(*probe), "probe");
     if (unlikely(probe == NULL))
     {
         *pcount = 0;
@@ -42,7 +42,10 @@ void *vlc_probe (vlc_object_t *obj,
 
     module_t *mod = module_need (probe, capability, NULL, false);
     if (mod != NULL)
+    {
+        msg_Warn (probe, "probing halted");
         module_unneed (probe, mod);
+    }
 
     void *ret = probe->list;
     *pcount = probe->count;