Commit 03d64551 authored by Thomas Guillem's avatar 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.
parent aa1e892a
...@@ -128,7 +128,7 @@ struct input_item_node_t ...@@ -128,7 +128,7 @@ struct input_item_node_t
bool b_can_loop; 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 ); VLC_API void input_item_SetName( input_item_t *p_item, const char *psz_name );
/** /**
......
...@@ -494,7 +494,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current ) ...@@ -494,7 +494,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
if( unlikely(p_item == NULL) ) if( unlikely(p_item == NULL) )
continue; 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) ) if( likely(asprintf( &psz_opt, "cdda-track=%i", i+1 ) != -1) )
{ {
......
...@@ -694,7 +694,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -694,7 +694,7 @@ static int Open( vlc_object_t * p_this )
} }
msg_Dbg( p_demux, "adding ref = `%s'", psz_ref ); msg_Dbg( p_demux, "adding ref = `%s'", psz_ref );
input_item_t *p_item = input_item_New( psz_ref, NULL ); 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 ); input_item_node_AppendItem( p_subitems, p_item );
vlc_gc_decref( p_item ); vlc_gc_decref( p_item );
} }
......
...@@ -267,7 +267,7 @@ static void ProcessEntry( int *pi_n_entry, xml_reader_t *p_xml_reader, ...@@ -267,7 +267,7 @@ static void ProcessEntry( int *pi_n_entry, xml_reader_t *p_xml_reader,
/* Create the input item */ /* Create the input item */
p_entry = input_item_NewExt( psz_mrl, psz_name, i_options, p_entry = input_item_NewExt( psz_mrl, psz_name, i_options,
(const char* const*) ppsz_options, VLC_INPUT_OPTION_TRUSTED, i_duration ); (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 */ /* Add the metadata */
if( psz_name ) if( psz_name )
...@@ -403,7 +403,7 @@ static int Demux( demux_t *p_demux ) ...@@ -403,7 +403,7 @@ static int Demux( demux_t *p_demux )
psz_txt = strdup( psz_node ); psz_txt = strdup( psz_node );
vlc_xml_decode( psz_txt ); vlc_xml_decode( psz_txt );
p_input = input_item_New( psz_txt, psz_title_asx ); 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 ); input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
......
...@@ -177,7 +177,7 @@ static int Demux( demux_t *p_demux ) ...@@ -177,7 +177,7 @@ static int Demux( demux_t *p_demux )
if( has_ext( psz_ignored_exts, p_item->psz_name ) ) if( has_ext( psz_ignored_exts, p_item->psz_name ) )
goto skip_item; 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 ) ) if( !input_item_node_AppendItem( p_node, p_item ) )
i_ret = VLC_ENOMEM; i_ret = VLC_ENOMEM;
skip_item: skip_item:
......
...@@ -142,7 +142,7 @@ static int Demux( demux_t *p_demux ) ...@@ -142,7 +142,7 @@ static int Demux( demux_t *p_demux )
if( psz_mrl ) if( psz_mrl )
{ {
p_input = input_item_New( psz_mrl, psz_name ); 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 ); input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
free( psz_mrl_orig ); free( psz_mrl_orig );
...@@ -187,7 +187,7 @@ static int Demux( demux_t *p_demux ) ...@@ -187,7 +187,7 @@ static int Demux( demux_t *p_demux )
if( psz_mrl ) if( psz_mrl )
{ {
p_input = input_item_New( psz_mrl, psz_name ); 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 ); input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
free( psz_mrl_orig ); free( psz_mrl_orig );
......
...@@ -383,7 +383,7 @@ static int Demux ( demux_t *p_demux ) ...@@ -383,7 +383,7 @@ static int Demux ( demux_t *p_demux )
return -1; 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 ) if( p_sys->i_packet_size && p_sys->psz_mcast_ip )
{ {
char *psz_option; char *psz_option;
......
...@@ -173,7 +173,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader, ...@@ -173,7 +173,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
input_item_t *p_input; input_item_t *p_input;
vlc_xml_decode( psz_mrl ); vlc_xml_decode( psz_mrl );
p_input = input_item_New( psz_mrl, psz_name ); 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 ); free( psz_mrl );
input_item_node_AppendItem( p_input_node, p_input ); input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
...@@ -326,7 +326,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader, ...@@ -326,7 +326,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
if( likely(p_input != NULL) ) 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 ) \ #define SADD_INFO( type, field ) \
if( field ) \ if( field ) \
......
...@@ -502,7 +502,7 @@ static bool parse_track_node COMPLEX_INTERFACE ...@@ -502,7 +502,7 @@ static bool parse_track_node COMPLEX_INTERFACE
} }
else else
input_item_SetURI(p_new_input, psz_value); 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 else
{ {
......
...@@ -574,7 +574,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L, ...@@ -574,7 +574,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
/* Append item to playlist */ /* Append item to playlist */
if( p_parent ) /* Add to node */ 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 ); input_item_node_AppendItem( p_parent_node, p_input );
} }
else /* Play or Enqueue (preparse) */ else /* Play or Enqueue (preparse) */
......
...@@ -157,10 +157,8 @@ void input_item_SetMeta( input_item_t *p_i, vlc_meta_type_t meta_type, const cha ...@@ -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 ); vlc_event_send( &p_i->event_manager, &event );
} }
/* FIXME GRRRRRRRRRR args should be in the reverse order to be void input_item_CopyOptions( input_item_t *p_child,
* consistent with (nearly?) all or copy funcs */ input_item_t *p_parent )
void input_item_CopyOptions( input_item_t *p_parent,
input_item_t *p_child )
{ {
char **optv = NULL; char **optv = NULL;
uint8_t *flagv = NULL; uint8_t *flagv = NULL;
...@@ -1013,7 +1011,7 @@ input_item_t *input_item_Copy( input_item_t *p_input ) ...@@ -1013,7 +1011,7 @@ input_item_t *input_item_Copy( input_item_t *p_input )
if( likely(item != NULL) ) if( likely(item != NULL) )
{ /* No need to lock; no other thread has seen this new item yet. */ { /* 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; item->p_meta = meta;
} }
......
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