[vlc-commits] input/item: correctly invert CopyOptions argument order

Thomas Guillem git at videolan.org
Thu Apr 14 10:21:24 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Apr 11 15:44:00 2016 +0200| [03d6455106d93b6266d4dca27ac25b72486cd418] | committer: Thomas Guillem

input/item: correctly invert CopyOptions argument order

Do not add a const qualifier for the p_parent since mutexes operations are not
const. Forgot to invert one call in input_item_Copy.

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

 include/vlc_input_item.h           |    2 +-
 modules/access/cdda.c              |    2 +-
 modules/demux/mp4/mp4.c            |    2 +-
 modules/demux/playlist/asx.c       |    4 ++--
 modules/demux/playlist/directory.c |    2 +-
 modules/demux/playlist/pls.c       |    4 ++--
 modules/demux/playlist/sgimb.c     |    2 +-
 modules/demux/playlist/shoutcast.c |    4 ++--
 modules/demux/playlist/xspf.c      |    2 +-
 modules/lua/vlc.c                  |    2 +-
 src/input/item.c                   |    8 +++-----
 11 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 0ff51e3..14f569c 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -128,7 +128,7 @@ struct input_item_node_t
     bool                   b_can_loop;
 };
 
-VLC_API void input_item_CopyOptions( input_item_t *p_parent, input_item_t *p_child );
+VLC_API void input_item_CopyOptions( input_item_t *p_child, input_item_t *p_parent );
 VLC_API void input_item_SetName( input_item_t *p_item, const char *psz_name );
 
 /**
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index e17bf86..5253ea5 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -494,7 +494,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
         if( unlikely(p_item == NULL) )
             continue;
 
-        input_item_CopyOptions( p_current, p_item );
+        input_item_CopyOptions( p_item, p_current );
 
         if( likely(asprintf( &psz_opt, "cdda-track=%i", i+1 ) != -1) )
         {
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 5bd2527..582e9fd 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -694,7 +694,7 @@ static int Open( vlc_object_t * p_this )
                 }
                 msg_Dbg( p_demux, "adding ref = `%s'", psz_ref );
                 input_item_t *p_item = input_item_New( psz_ref, NULL );
-                input_item_CopyOptions( p_current, p_item );
+                input_item_CopyOptions( p_item, p_current );
                 input_item_node_AppendItem( p_subitems, p_item );
                 vlc_gc_decref( p_item );
             }
diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index 13c1237..ed216c9 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -267,7 +267,7 @@ static void ProcessEntry( int *pi_n_entry, xml_reader_t *p_xml_reader,
                 /* Create the input item */
                 p_entry = input_item_NewExt( psz_mrl, psz_name, i_options,
                         (const char* const*) ppsz_options, VLC_INPUT_OPTION_TRUSTED, i_duration );
-                input_item_CopyOptions( p_current_input, p_entry );
+                input_item_CopyOptions( p_entry, p_current_input );
 
                 /* Add the metadata */
                 if( psz_name )
@@ -403,7 +403,7 @@ static int Demux( demux_t *p_demux )
                 psz_txt = strdup( psz_node );
                 vlc_xml_decode( psz_txt );
                 p_input = input_item_New( psz_txt, psz_title_asx );
-                input_item_CopyOptions( p_current_input, p_input );
+                input_item_CopyOptions( p_input, p_current_input );
                 input_item_node_AppendItem( p_subitems, p_input );
 
                 vlc_gc_decref( p_input );
diff --git a/modules/demux/playlist/directory.c b/modules/demux/playlist/directory.c
index 4ad4d76..e1ff41d 100644
--- a/modules/demux/playlist/directory.c
+++ b/modules/demux/playlist/directory.c
@@ -177,7 +177,7 @@ static int Demux( demux_t *p_demux )
         if( has_ext( psz_ignored_exts, p_item->psz_name ) )
             goto skip_item;
 
-        input_item_CopyOptions( p_node->p_item, p_item );
+        input_item_CopyOptions( p_item, p_node->p_item );
         if( !input_item_node_AppendItem( p_node, p_item ) )
             i_ret = VLC_ENOMEM;
 skip_item:
diff --git a/modules/demux/playlist/pls.c b/modules/demux/playlist/pls.c
index 7646aae..e132023 100644
--- a/modules/demux/playlist/pls.c
+++ b/modules/demux/playlist/pls.c
@@ -142,7 +142,7 @@ static int Demux( demux_t *p_demux )
             if( psz_mrl )
             {
                 p_input = input_item_New( psz_mrl, psz_name );
-                input_item_CopyOptions( p_current_input, p_input );
+                input_item_CopyOptions( p_input, p_current_input );
                 input_item_node_AppendItem( p_subitems, p_input );
                 vlc_gc_decref( p_input );
                 free( psz_mrl_orig );
@@ -187,7 +187,7 @@ static int Demux( demux_t *p_demux )
     if( psz_mrl )
     {
         p_input = input_item_New( psz_mrl, psz_name );
-        input_item_CopyOptions( p_current_input, p_input );
+        input_item_CopyOptions( p_input, p_current_input );
         input_item_node_AppendItem( p_subitems, p_input );
         vlc_gc_decref( p_input );
         free( psz_mrl_orig );
diff --git a/modules/demux/playlist/sgimb.c b/modules/demux/playlist/sgimb.c
index 229172f..418278e 100644
--- a/modules/demux/playlist/sgimb.c
+++ b/modules/demux/playlist/sgimb.c
@@ -383,7 +383,7 @@ static int Demux ( demux_t *p_demux )
         return -1;
     }
 
-    input_item_CopyOptions( p_current_input, p_child );
+    input_item_CopyOptions( p_child, p_current_input );
     if( p_sys->i_packet_size && p_sys->psz_mcast_ip )
     {
         char *psz_option;
diff --git a/modules/demux/playlist/shoutcast.c b/modules/demux/playlist/shoutcast.c
index 336361c..c3e1c54 100644
--- a/modules/demux/playlist/shoutcast.c
+++ b/modules/demux/playlist/shoutcast.c
@@ -173,7 +173,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
                         input_item_t *p_input;
                         vlc_xml_decode( psz_mrl );
                         p_input = input_item_New( psz_mrl, psz_name );
-                        input_item_CopyOptions( p_input_node->p_item, p_input );
+                        input_item_CopyOptions( p_input, p_input_node->p_item );
                         free( psz_mrl );
                         input_item_node_AppendItem( p_input_node, p_input );
                         vlc_gc_decref( p_input );
@@ -326,7 +326,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
 
                     if( likely(p_input != NULL) )
                     {
-                        input_item_CopyOptions( p_input_node->p_item, p_input );
+                        input_item_CopyOptions( p_input, p_input_node->p_item );
 
 #define SADD_INFO( type, field ) \
                     if( field ) \
diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index 55c721a..d4150d2 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -502,7 +502,7 @@ static bool parse_track_node COMPLEX_INTERFACE
             }
             else
                 input_item_SetURI(p_new_input, psz_value);
-            input_item_CopyOptions(p_input_item, p_new_input);
+            input_item_CopyOptions(p_new_input, p_input_item);
         }
         else
         {
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 4340038..6c2430a 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -574,7 +574,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                     /* Append item to playlist */
                     if( p_parent ) /* Add to node */
                     {
-                        input_item_CopyOptions( p_parent, p_input );
+                        input_item_CopyOptions( p_input, p_parent );
                         input_item_node_AppendItem( p_parent_node, p_input );
                     }
                     else /* Play or Enqueue (preparse) */
diff --git a/src/input/item.c b/src/input/item.c
index 3b4101a..3a6a20d 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -157,10 +157,8 @@ void input_item_SetMeta( input_item_t *p_i, vlc_meta_type_t meta_type, const cha
     vlc_event_send( &p_i->event_manager, &event );
 }
 
-/* FIXME GRRRRRRRRRR args should be in the reverse order to be
- * consistent with (nearly?) all or copy funcs */
-void input_item_CopyOptions( input_item_t *p_parent,
-                             input_item_t *p_child )
+void input_item_CopyOptions( input_item_t *p_child,
+                             input_item_t *p_parent )
 {
     char **optv = NULL;
     uint8_t *flagv = NULL;
@@ -1013,7 +1011,7 @@ input_item_t *input_item_Copy( input_item_t *p_input )
 
     if( likely(item != NULL) )
     {   /* No need to lock; no other thread has seen this new item yet. */
-        input_item_CopyOptions( p_input, item );
+        input_item_CopyOptions( item, p_input );
         item->p_meta = meta;
     }
 



More information about the vlc-commits mailing list