]> git.sesse.net Git - vlc/blobdiff - src/misc/messages.c
Move some internal message stuff to src/
[vlc] / src / misc / messages.c
index fde2d124c2f00fdeb43f4d47a3c32d01d4b683a5..b55a3e6d90e9bf0c5c794406bca774adbb5c623a 100644 (file)
@@ -82,9 +82,9 @@ static void PrintMsg ( vlc_object_t *, msg_item_t * );
  * Initialize messages queues
  * This function initializes all message queues
  */
-void __msg_Create( vlc_object_t *p_this )
+void msg_Create (libvlc_int_t *p_libvlc)
 {
-    libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
+    libvlc_priv_t *priv = libvlc_priv (p_libvlc);
     vlc_mutex_init( &priv->msg_bank.lock );
 
     for( int i = 0; i < 2; i++ )
@@ -110,9 +110,9 @@ void __msg_Create( vlc_object_t *p_this )
 /**
  * Flush all message queues
  */
-void __msg_Flush( vlc_object_t *p_this )
+void msg_Flush (libvlc_int_t *p_libvlc)
 {
-    libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
+    libvlc_priv_t *priv = libvlc_priv (p_libvlc);
 
     for( int i = 0 ; i < NB_QUEUES ; i++ )
     {
@@ -129,14 +129,14 @@ void __msg_Flush( vlc_object_t *p_this )
  * then frees all the allocated ressources
  * No other messages interface functions should be called after this one.
  */
-void __msg_Destroy( vlc_object_t *p_this )
+void msg_Destroy (libvlc_int_t *p_libvlc)
 {
-    libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
+    libvlc_priv_t *priv = libvlc_priv (p_libvlc);
 
     for( int i = NB_QUEUES -1 ; i >= 0;  i-- )
     {
         if( QUEUE(i).i_sub )
-            msg_Err( p_this, "stale interface subscribers" );
+            msg_Err( p_libvlc, "stale interface subscribers" );
 
         FlushMsg( &QUEUE(i) );
 
@@ -268,6 +268,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_queue, int i_type,
                       const char *psz_module,
                       const char *psz_format, va_list _args )
 {
+    assert (p_this);
     libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
     int         i_header_size;             /* Size of the additionnal header */
     vlc_object_t *p_obj;
@@ -282,17 +283,6 @@ static void QueueMsg( vlc_object_t *p_this, int i_queue, int i_type,
     int          i_size = strlen(psz_format) + INTF_MAX_MSG_SIZE;
 #endif
 
-    if( p_this == NULL )
-    {
-#ifndef NDEBUG
-        if( i_type == VLC_MSG_DBG )
-            return;
-#endif
-        utf8_vfprintf( stderr, psz_format, _args );
-        fputc ('\n', stderr);
-        return;
-    }
-
     if( p_this->i_flags & OBJECT_FLAGS_QUIET ||
         (p_this->i_flags & OBJECT_FLAGS_NODBG && i_type == VLC_MSG_DBG) )
         return;