Commit ce3c481d authored by Thomas Guillem's avatar Thomas Guillem

input: remove useless lock

Here, in rdh_sort() (called from readdir_helper_finish()), input items are only
read and can't be used by any other threads since there are not propagated yet
(via input_item_node_PostAndDelete()).
parent e4a403d7
......@@ -1351,19 +1351,10 @@ static void rdh_sort(input_item_node_t *p_node)
if (p_node->i_children <= 0)
return;
/* Lock first all children. This avoids to lock/unlock them from each
* compar callback call */
for (int i = 0; i < p_node->i_children; i++)
vlc_mutex_lock(&p_node->pp_children[i]->p_item->lock);
/* Sort current node */
qsort(p_node->pp_children, p_node->i_children,
sizeof(input_item_node_t *), rdh_compar_filename);
/* Unlock all children */
for (int i = 0; i < p_node->i_children; i++)
vlc_mutex_unlock(&p_node->pp_children[i]->p_item->lock);
/* Sort all children */
for (int i = 0; i < p_node->i_children; i++)
rdh_sort(p_node->pp_children[i]);
......
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