[vlc-devel] [PATCH 1/2] input_item: add a owner placeholder
Rémi Denis-Courmont
remi at remlab.net
Fri Sep 18 19:26:38 CEST 2020
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.
>
> #define INPUT_ITEM_URI_NOP "vlc://nop" /* dummy URI for node/directory
> items */
--
Реми Дёни-Курмон
http://www.remlab.net/
More information about the vlc-devel
mailing list