[vlc-devel] commit: Qt4: store input_item_t* in plitem and handle metadata in model ( Ilkka Ollakka )

Jakob Leben jakob.leben at gmail.com
Fri Aug 14 17:38:00 CEST 2009


2009/8/14 Rémi Denis-Courmont <remi at remlab.net>

> And what are you suggesting?
>

I have stated my two suggestions: either we always check if the target
address of the pointer can be found from the playlist root down, or we
always take care to correct playlist_item's internal pointers (which I hope
I succeeded to show is not so very common and obvious in practice).

2009/8/14 Rémi Denis-Courmont <remi at remlab.net>

> Currently, we use playlist item IDs, which are weak handles, which are
> buggy. There is a warranty that you won't get a dangling pointer from an
> item ID. But if you save the item ID for later retrieval, you may later get
> another item (due to ID wrap-around), or no ID at all. In fact, if things
> wrap around, hell breaks loose because we may assign the same ID to more
> than one item...
>

That's why I think using the pointers to items directly is cool, because the
system takes care itself that a newly allocated memory will never overlap an
already allocated one, hence a pointer to an item will point to it and only
it as long as the item is not freed. I see pointers as the best handles you
can have. Only you have to do reference counting then.

By the way, should it be a parent item who raises reference count on an item
when it becomes it's child? or should there be one reference number on every
playlist item per interface, per user so to speak or maybe per thread? Or
both?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090814/e5c5e068/attachment.html>


More information about the vlc-devel mailing list