[vlc-devel] [PATCH 1/7] input: also copy input slaves in input_item_Copy

Pierre Lamot pierre at videolabs.io
Mon Oct 21 18:08:53 CEST 2019


---
 src/input/item.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/input/item.c b/src/input/item.c
index e8db39ca28..a01d4bb3e4 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1119,6 +1119,22 @@ input_item_t *input_item_Copy( input_item_t *p_input )
         vlc_meta_Merge( meta, p_input->p_meta );
     }
     b_net = p_input->b_net;
+
+    if( likely(item != NULL) && p_input->i_slaves > 0 )
+    {
+        for( int i = 0; i < p_input->i_slaves; i++ )
+        {
+            input_item_slave_t* slave = input_item_slave_New(
+                        p_input->pp_slaves[i]->psz_uri,
+                        p_input->pp_slaves[i]->i_type,
+                        p_input->pp_slaves[i]->i_priority);
+            if( unlikely(slave != NULL) )
+            {
+                TAB_APPEND(item->i_slaves, item->pp_slaves, slave);
+            }
+        }
+    }
+
     vlc_mutex_unlock( &p_input->lock );
 
     if( likely(item != NULL) )
-- 
2.17.1



More information about the vlc-devel mailing list