[vlc-devel] commit: Revert "messages: Prefer the object name over the object type if type is VLC_GENERIC." ( Pierre d'Herbemont )

git version control git at videolan.org
Sun Jul 6 18:40:54 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jul  6 18:43:06 2008 +0200| [e7b0790a8639643acf46060d68e3a3ea9627e174]

Revert "messages: Prefer the object name over the object type if type is VLC_GENERIC."

This reverts commit 0386618539878fde94110df15b77ba7c79e54e8c.

Conflicts:

	src/misc/messages.c

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

 include/vlc_messages.h              |    2 +-
 modules/gui/beos/MessagesWindow.cpp |    2 +-
 src/control/log.c                   |    2 +-
 src/misc/messages.c                 |   13 +++----------
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/include/vlc_messages.h b/include/vlc_messages.h
index 6035f81..1ce7d7b 100644
--- a/include/vlc_messages.h
+++ b/include/vlc_messages.h
@@ -44,7 +44,7 @@ typedef struct
 {
     int     i_type;                             /**< message type, see below */
     int     i_object_id;
-    char *  psz_object;
+    const char *psz_object_type;
     char *  psz_module;
     char *  psz_msg;                            /**< the message itself */
     char *  psz_header;                         /**< Additional header */
diff --git a/modules/gui/beos/MessagesWindow.cpp b/modules/gui/beos/MessagesWindow.cpp
index b83107e..b4b2029 100644
--- a/modules/gui/beos/MessagesWindow.cpp
+++ b/modules/gui/beos/MessagesWindow.cpp
@@ -80,7 +80,7 @@ void MessagesView::Pulse()
                 case VLC_MSG_DBG: color = gray; break;
             }
 
-            psz_module_type = p_sub->p_msg[i_start].psz_object;
+            psz_module_type = p_sub->p_msg[i_start].psz_object_type;
 
             if( LockLooper() )
             {
diff --git a/src/control/log.c b/src/control/log.c
index 11b0fe6..b8fb181 100644
--- a/src/control/log.c
+++ b/src/control/log.c
@@ -178,7 +178,7 @@ libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
         vlc_mutex_lock(p_iter->p_messages->p_lock);
         msg = p_iter->p_messages->p_msg+i_pos;
         buffer->i_severity  = msg->i_type;
-        buffer->psz_type    = msg->psz_object;
+        buffer->psz_type    = msg->psz_object_type;
         buffer->psz_name    = msg->psz_module;
         buffer->psz_header  = msg->psz_header;
         buffer->psz_message = msg->psz_msg;
diff --git a/src/misc/messages.c b/src/misc/messages.c
index f00a1de..be832c6 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -78,11 +78,6 @@ static void QueueMsg ( vlc_object_t *, int, const char *,
 static void FlushMsg ( msg_queue_t * );
 static void PrintMsg ( vlc_object_t *, msg_item_t * );
 
-static inline char * object_description( vlc_object_t * p_this )
-{
-    return strdup( p_this->psz_object_type );
-}
-
 /**
  * Initialize messages queues
  * This function initializes all message queues
@@ -427,7 +422,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
 
             p_item->i_type =        VLC_MSG_WARN;
             p_item->i_object_id =   p_this->i_object_id;
-            p_item->psz_object =    object_description( p_this );
+            p_item->psz_object_type = p_this->psz_object_type;
             p_item->psz_module =    strdup( "message" );
             p_item->psz_msg =       strdup( "message queue overflowed" );
             p_item->psz_header =    NULL;
@@ -448,7 +443,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
     /* Fill message information fields */
     p_item->i_type =        i_type;
     p_item->i_object_id =   p_this->i_object_id;
-    p_item->psz_object =    object_description( p_this );
+    p_item->psz_object_type = p_this->psz_object_type;
     p_item->psz_module =    strdup( psz_module );
     p_item->psz_msg =       psz_str;
     p_item->psz_header =    psz_header;
@@ -460,7 +455,6 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
         free( p_item->psz_module );
         free( p_item->psz_msg );
         free( p_item->psz_header );
-        free( p_item->psz_object );
     }
 
     vlc_mutex_unlock ( &p_queue->lock );
@@ -506,7 +500,6 @@ static void FlushMsg ( msg_queue_t *p_queue )
         free( p_queue->msg[i_index].psz_msg );
         free( p_queue->msg[i_index].psz_module );
         free( p_queue->msg[i_index].psz_header );
-        free( p_queue->msg[i_index].psz_object );
     }
 
     /* Update the new start value */
@@ -552,7 +545,7 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
             break;
     }
 
-    psz_object = p_item->psz_object;
+    psz_object = p_item->psz_object_type;
 
 #ifdef UNDER_CE
 #   define CE_WRITE(str) WriteFile( QUEUE.logfile, \




More information about the vlc-devel mailing list