Page 1 of 1

puzzle about source code src/misc/block.c

Posted: 14 Mar 2006 07:49
by NEW CONE
vlc-0.8.4a
file: src/misc/block.c
see the red italic ,line 154:
-----------------------------
block_fifo_t *__block_FifoNew( vlc_object_t *p_obj )
{
block_fifo_t *p_fifo;

p_fifo = malloc( sizeof( vlc_object_t ) );
vlc_mutex_init( p_obj, &p_fifo->lock );
vlc_cond_init( p_obj, &p_fifo->wait );
p_fifo->i_depth = p_fifo->i_size = 0;
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;

return p_fifo;
}
-----------------------------
why malloc a 'vlc_object_t ' structure ?

with regards

Posted: 14 Mar 2006 14:05
by dionoea
Good question ... This seems to be a mistake. I'll fix it.

Posted: 15 Mar 2006 04:20
by NEW CONE
thanks,

Posted: 15 Mar 2006 15:35
by dionoea
Might i ask how you noticed this ?