- int i_parent_id; \
- vlc_bool_t b_play; \
- playlist_item_t *p_current, *p_item_in_category = NULL; \
- input_item_t *p_input; \
- playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_demux, \
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); \
- if( !p_playlist ) \
- { \
- msg_Err( p_demux, "can't find playlist" ); \
- return VLC_EGENERIC; \
- } \
- i_parent_id = var_CreateGetInteger( p_demux, "parent-item" ); \
- if( i_parent_id > 0 ) \
- { \
- b_play = VLC_FALSE; \
- p_current = playlist_ItemGetById( p_playlist, i_parent_id ); \
- } \
- else \
- { \
- b_play = E_(FindItem)( p_demux, p_playlist, &p_current ); \
- p_item_in_category = playlist_ItemToNode( p_playlist, p_current ); \
- p_current->p_input->i_type = ITEM_TYPE_PLAYLIST; \
- }
+ input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
+ input_item_t *p_current_input = input_GetItem( p_input_thread );