vlc/vlc-3.0 | branch: master | Alaric Senat <dev.ase...@posteo.net> | Thu Apr 
22 11:42:12 2021 +0200| [bc53d6edc62772765924118e7e6ed39ac7464a11] | committer: 
Jean-Baptiste Kempf

input: parse `:input-slave" options earlier

Move the option parsing right before the input-item slaves copy.  This
avoid input-slaves unnecessary duplication each time the input is
reparsed as the input-item slaves copy itself avoid duplicating.

Fixes #19977

(cherry picked from commit 4f7522e620be01a3662bd985aeca1a2b8c4b7ff4)
Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=bc53d6edc62772765924118e7e6ed39ac7464a11
---

 src/input/input.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 81cfac86cc..f8c0cf796c 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1148,6 +1148,9 @@ static void LoadSlaves( input_thread_t *p_input )
         free( psz_autopath );
     }
 
+    /* Add slaves from the "input-slave" option */
+    GetVarSlaves( p_input, &pp_slaves, &i_slaves );
+
     /* Add slaves found by the directory demuxer or via libvlc */
     input_item_t *p_item = input_priv(p_input)->p_item;
     vlc_mutex_lock( &p_item->lock );
@@ -1165,9 +1168,6 @@ static void LoadSlaves( input_thread_t *p_input )
     TAB_CLEAN( p_item->i_slaves, p_item->pp_slaves );
     vlc_mutex_unlock( &p_item->lock );
 
-    /* Add slaves from the "input-slave" option */
-    GetVarSlaves( p_input, &pp_slaves, &i_slaves );
-
     if( i_slaves > 0 )
         qsort( pp_slaves, i_slaves, sizeof (input_item_slave_t*),
                SlaveCompare );

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to