[vlc-devel] [PATCHv2] Fix input variables

Pierre Ynard linkfanel at yahoo.fr
Wed Nov 24 11:20:50 CET 2010


> On Wed, Nov 24, 2010 at 09:15:30AM +0100, Pierre Ynard wrote:
> > The input resources create a dedicated parent object, and input
> > variables are parsed and set on this object too.
>  I don't think it is the job of the input_resource_t to do that, but
> of the one creating an input.
>  For example, in the current code, the parent wanted for normal
> playback is probably the playlist.
>  So if I understand your issue, you just need to create an parent
> object per input in VLM and that should be enough.

Well I was trying to fix the general case, and it seemed to me that some
dedicated object would be needed in any case, so I thought it would be
better not to repeat that logic everywhere. The point of that extra
object is to hold input variables and be used by input resources so to
me it sounded much like it belonged in input resources, but okay.

> > +    /* Parse input options */
> > +    vlc_object_t *p_obj = input_resource_GetParent(
> > p_input->p->p_resource );
> > +    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) );
> > +        var_OptionParse( p_obj, p_item->ppsz_options[i],
> > +                         !!(p_item->optflagv[i] &
> > VLC_INPUT_OPTION_TRUSTED) );
> > +    }
> > +    vlc_mutex_unlock( &p_item->lock );
> > +    vlc_object_release( p_obj );
>  Thoses variables must be scoped by input and not reused from one
> input to the other one (by definition)...

They are scoped since they are cleaned up when the input changes.

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list