]> git.sesse.net Git - vlc/blobdiff - src/misc/messages.c
Disable check_OS_capability() on OS/2
[vlc] / src / misc / messages.c
index 3c577740974fcc1885a98f5900392245fe17b332..8bc8b16e451ca49460231e008167b04aecf23ea8 100644 (file)
@@ -113,7 +113,7 @@ void vlc_Unsubscribe (msg_subscription_t *sub)
 
 /**
  * Emit a log message.
- * \param obj VLC object emitting the message
+ * \param obj VLC object emitting the message or NULL
  * \param type VLC_MSG_* message type (info, error, warning or debug)
  * \param module name of module from which the message come
  *               (normally MODULE_STRING)
@@ -140,9 +140,7 @@ static void PrintMsg (void *, int, const msg_item_t *, const char *, va_list);
 void vlc_vaLog (vlc_object_t *obj, int type, const char *module,
                 const char *format, va_list args)
 {
-    assert (obj != NULL);
-
-    if (obj->i_flags & OBJECT_FLAGS_QUIET)
+    if (obj != NULL && obj->i_flags & OBJECT_FLAGS_QUIET)
         return;
 
     /* C locale to get error messages in English in the logs */
@@ -209,7 +207,7 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module,
     msg_item_t msg;
 
     msg.i_object_id = (uintptr_t)obj;
-    msg.psz_object_type = obj->psz_object_type;
+    msg.psz_object_type = (obj != NULL) ? obj->psz_object_type : "generic";
     msg.psz_module = module;
     msg.psz_header = NULL;
 
@@ -298,7 +296,7 @@ static void PrintMsg (void *d, int type, const msg_item_t *p_item,
     utf8_fprintf (stream, "%s %s%s: ", p_item->psz_module,
                   p_item->psz_object_type, msg_type[type]);
     utf8_vfprintf (stream, format, ap);
-    fputc_unlocked ('\n', stream);
+    putc_unlocked ('\n', stream);
 #if defined (WIN32) || defined (__OS2__)
     fflush (stream);
 #endif