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
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 );
/**
......
......@@ -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) )
{
......
......@@ -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 );
}
......
......@@ -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 );
......
......@@ -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:
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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 ) \
......
......@@ -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
{
......
......@@ -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) */
......
......@@ -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;
}
......
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