[vlc-devel] [PATCH] input/item: sort before attaching slaves

Thomas Guillem thomas at gllm.fr
Fri Oct 18 10:51:32 CEST 2019


The order of readdir() is completely filesystem dependent.

Slaves should be attached using the same order across multiple OSses/access
modules.

This fixes the test_libvlc_slaves on some system when the entry order from
readdir() is different.

This patch need to be backported to VLC 3.0.
---
 src/input/item.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/item.c b/src/input/item.c
index e8db39ca280..fbd74cc95fe 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1809,8 +1809,8 @@ void vlc_readdir_helper_finish(struct vlc_readdir_helper *p_rdh, bool b_success)
 {
     if (b_success)
     {
-        rdh_attach_slaves(p_rdh, p_rdh->p_node);
         rdh_sort(p_rdh->p_node);
+        rdh_attach_slaves(p_rdh, p_rdh->p_node);
     }
     free(p_rdh->psz_ignored_exts);
 
-- 
2.20.1



More information about the vlc-devel mailing list