Commit 9bf71ea2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Only take top-most object message header

In practice, multiple headers cannot happen. Only VLM input and LUA
interface use this hack.
parent f68b07bf
......@@ -261,7 +261,6 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
const char *psz_module,
const char *psz_format, va_list _args)
{
vlc_object_t *p_obj;
char * psz_str = NULL; /* formatted message string */
va_list args;
......@@ -372,37 +371,16 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
msg.psz_object_type = p_this->psz_object_type;
msg.psz_module = psz_module;
msg.psz_msg = psz_str;
msg.psz_header = NULL;
char *psz_header = NULL;
size_t i_header_size = 0;
p_obj = p_this;
while( p_obj != NULL )
{
char *psz_old = NULL;
if( p_obj->psz_header )
{
i_header_size += strlen( p_obj->psz_header ) + 4;
if( psz_header )
{
psz_old = strdup( psz_header );
psz_header = xrealloc( psz_header, i_header_size );
snprintf( psz_header, i_header_size , "[%s] %s",
p_obj->psz_header, psz_old );
}
else
for (vlc_object_t *o = p_this; o != NULL; o = o->p_parent)
if (o->psz_header != NULL)
{
psz_header = xmalloc( i_header_size );
snprintf( psz_header, i_header_size, "[%s]",
p_obj->psz_header );
}
}
free( psz_old );
p_obj = p_obj->p_parent;
if (asprintf (&msg.psz_header, "[%s]", o->psz_header) == -1)
msg.psz_header = NULL;
break;
}
msg.psz_header = psz_header;
PrintMsg( p_this, &msg );
vlc_rwlock_rdlock (&bank->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment