When adding an item X whose underlying input_item_t's i_type is
ITEM_TYPE_NODE (like a folder), we need to call playlist_GetNodeDuration
on X again for the duration of X to be the sum of the durations of X's
children.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
if( node->i_children != -1 )
for( int i = 0; i < node->i_children; i++ )
- mt_duration += input_item_GetDuration( node->pp_children[i]->p_input );
+ {
+ input_item_t* p_input = node->pp_children[i]->p_input;
+ if ( p_input->i_type == ITEM_TYPE_NODE )
+ mt_duration += playlist_GetNodeDuration( node->pp_children[i] );
+ else
+ mt_duration += input_item_GetDuration( p_input );
+ }
return mt_duration;
}