[vlc-devel] [PATCH 1/2] input_item: add a owner placeholder

Thomas Guillem thomas at gllm.fr
Mon Sep 21 09:58:40 CEST 2020



On Fri, Sep 18, 2020, at 19:26, Rémi Denis-Courmont wrote:
> Le perjantaina 18. syyskuuta 2020, 15.29.31 EEST Thomas Guillem a écrit :
> > This will be used by libvlc_media to store the media instance into an
> > input_item. This will allow to get the media corresponding to an item
> > when propagating media events.
> > ---
> >  include/vlc_input_item.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
> > index 8e5ffc98eca..151c90f17dd 100644
> > --- a/include/vlc_input_item.h
> > +++ b/include/vlc_input_item.h
> > @@ -120,6 +120,9 @@ struct input_item_t
> > 
> >      bool        b_preparse_interact; /**< Force interaction with the user
> > when preparsing.*/
> > +
> > +    void        *owner;              /**< Private data that can only be set
> > by +                                          the owner (one calling New())
> > */ };
> 
> You also need to set it before the input item becomes visible to anything. 
> Otherwise, the change notification callbacks will race reading the value.


I wanted to trust the user for this new variable usage to set it just after the input item creation. 
But I forgot about the event manager "sync point" so indeed, it will race. I will add it in the item constructor then.

> 
> > 
> >  #define INPUT_ITEM_URI_NOP "vlc://nop" /* dummy URI for node/directory
> > items */
> 
> 
> -- 
> Реми Дёни-Курмон
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list