Commit 8eae542a authored by Wieland Hoffmann's avatar Wieland Hoffmann Committed by Jean-Baptiste Kempf

playlist: Recurse on ITEM_TYPE_NODE when calculating the duration

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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e714549a
......@@ -733,7 +733,13 @@ mtime_t playlist_GetNodeDuration( playlist_item_t* node )
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;
}
......
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