Commit f640890d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: move var_OptionParse() code to item.c

parent 7491a5ff
......@@ -188,6 +188,8 @@ enum input_item_option_e
*/
VLC_API int input_item_AddOption(input_item_t *, const char *, unsigned i_flags );
void input_item_ApplyOptions(vlc_object_t *, input_item_t *);
/* */
VLC_API bool input_item_HasErrorWhenReading( input_item_t * );
VLC_API void input_item_SetMeta( input_item_t *, vlc_meta_type_t meta_type, const char *psz_val );
......
......@@ -318,12 +318,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
}
/* Parse input options */
vlc_mutex_lock( &p_item->lock );
assert( (int)p_item->optflagc == p_item->i_options );
for( i = 0; i < p_item->i_options; i++ )
var_OptionParse( VLC_OBJECT(p_input), p_item->ppsz_options[i],
!!(p_item->optflagv[i] & VLC_INPUT_OPTION_TRUSTED) );
vlc_mutex_unlock( &p_item->lock );
input_item_ApplyOptions( VLC_OBJECT(p_input), p_item );
p_input->b_preparsing = b_quick;
p_input->psz_header = psz_header ? strdup( psz_header ) : NULL;
......
......@@ -518,6 +518,17 @@ out:
return err;
}
void input_item_ApplyOptions(vlc_object_t *obj, input_item_t *item)
{
vlc_mutex_lock(&item->lock);
assert(item->optflagc == (unsigned)item->i_options);
for (unsigned i = 0; i < (unsigned)item->i_options; i++)
var_OptionParse(obj, item->ppsz_options[i],
!!(item->optflagv[i] & VLC_INPUT_OPTION_TRUSTED));
vlc_mutex_unlock(&item->lock);
}
static info_category_t *InputItemFindCat( input_item_t *p_item,
int *pi_index, const char *psz_cat )
{
......
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