[vlc-devel] Question about input_item_node_* functions

Austin Burrow atburrow at gmail.com
Wed Jun 9 02:04:56 CEST 2010

Thanks for your detailed response, that helped out a lot. The downside about using services_discovery_AddItem/services_discovery_RemoveItem is that the whole tree must be rebuilt causing it to flash when it is being rebuilt. This seems like it would add more frustration for the user as they would be unable to expand the tree while the server is pushing updates. An example would be if a person added a large folder (which contained subfolders) to MediaTomb.  MediaTomb would then scan the directory constantly pushing updates. This could go on for minutes depending on how large the folder was. A solution could be to not display the list until it is built, but on the client side there is no way to know how big the list will be. A complete fix for this would be to have access to each node being displayed and having the option to remove it from the list, but as you said, input_item_node_* does not offer that capability, and services_discovery_RemoveItem will remove the whole list.



Austin B


From: vlc-devel-bounces at videolan.org [mailto:vlc-devel-bounces at videolan.org] On Behalf Of Jakob Leben
Sent: Monday, June 07, 2010 6:57 AM
To: Mailing list for VLC media player developers
Subject: Re: [vlc-devel] Question about input_item_node_* functions


On Mon, Jun 7, 2010 at 6:02 AM, Austin Burrow <atburrow at gmail.com> wrote:

I had a quick question about the workings of input_item_node_* functions.  Looking through the documentation and some code, I've pretty much figured out how to make an item node, but I was wondering how to remove an item from the actual list after you've done a call to input_item_node_PostAndDelete.  I've looked around and found input_item_node_Delete, but it looks like that just deletes my locally created list before (or after) it was posted internally.

For example, the upnp_intel SD module creates a list of UPnP servers and their sub-items, but when the UPnP servers rebroadcast their files, some files could be out of date but they aren't being removed from the tree list.  Knowing the workings of input_item_node_* would help me fix this bug.


Your observation about input_item_node_X is correct. An "input item node" with all it's children can either be posted and deleted or only deleted. After that, it is freed and inaccessible.

Please note that input_item_node_t is not meant for continuous storage of information but only to pass information from a Playlist Demuxer to the VLC core. Usage of it for SD is anomalous anyway. SDs should instead use services_discovery_AddItem / services_discovery_RemoveItem. However, that only allows for two levels of item hierarchy, which is the reason for some SDs to go for other means of publishing their items.

Anyway, if a SD needs to "un-publish" an item it has published, it should have internally (by it's own means and data structures) stored a reference to the input_item_t it has published and then call services_discovery_RemoveItem with that item as an argument.

Best regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100608/793548ce/attachment.html>

More information about the vlc-devel mailing list