So far, the input was attached after it inherited quite a bunch of
variables. This did not quite work. The problem lies in the dual use
of object attachment: variables inheritance and tree search.
Nowadays, the input object should not be looked for before it is
initialized. Only children objects use vlc_object_find anymore, and
they can only exist while the input is fully initialized. Other code
paths use playlist_CurrentInput() or such, which only ever return an
already initialized input (from input.c:Create()).
(N.B.: I wonder if there aren't similar issues in VOUT and AOUT)
if( p_input == NULL )
return NULL;
+ vlc_object_attach( p_input, p_parent );
+
/* Construct a nice name for the input timer */
char psz_timer_name[255];
char * psz_name = input_item_GetName( p_item );
/* Set the destructor when we are sure we are initialized */
vlc_object_set_destructor( p_input, (vlc_destructor_t)Destructor );
- /* Attach only once we are ready */
- vlc_object_attach( p_input, p_parent );
-
return p_input;
}