-// TODO: Create a permanent fix for the item duplication bug. The current fix
-// is essentially only a small hack. Although it fixes the problem, it introduces
-// annoying cosmetic issues with the playlist. For example, when the UPnP Server
-// rebroadcasts it's directory structure, the VLC Client deletes the old directory
-// structure, causing the user to go back to the root node of the directory. The
-// directory is then rebuilt, and the user is forced to traverse through the directory
-// to find the item they were looking for. Some servers may not push the directory
-// structure too often, but we cannot rely on this fix.
-//
-// I have thought up another fix, but this would require certain features to
-// be present within the VLC services discovery. Currently, services_discovery_AddItem
-// does not allow the programmer to nest items. It only allows a "2 deep" scope.
-// An example of the limitation is below:
-//
-// Root Directory
-// + Item 1
-// + Item 2
-//
-// services_discovery_AddItem will not let the programmer specify a child-node to
-// insert items into, so we would not be able to do the following:
-//
-// Root Directory
-// + Item 1
-// + Sub Item 1
-// + Item 2
-// + Sub Item 1 of Item 2
-// + Sub-Sub Item 1 of Sub Item 1
-//
-// This creates a HUGE limitation on what we are able to do. If we were able to do
-// the above, we could simply preserve the old directory listing, and compare what items
-// do not exist in the new directory listing, then remove them from the shown listing using
-// services_discovery_RemoveItem. If new files were introduced within an already existing
-// container, we could simply do so with services_discovery_AddItem.
-
-/*
- * Builds playlist based on available input items.
- */
-void MediaServer::_buildPlaylist( Container* p_parent, input_item_node_t *p_input_node )
-{
- bool b_send = p_input_node == NULL;
- if( b_send )
- p_input_node = input_item_node_Create( p_parent->getInputItem() );
-
- for ( unsigned int i = 0; i < p_parent->getNumContainers(); i++ )
- {
- Container* p_container = p_parent->getContainer( i );
-
- input_item_t* p_input_item = input_item_New( "vlc://nop",
- p_container->getTitle() );
- input_item_node_t *p_new_node =
- input_item_node_AppendItem( p_input_node, p_input_item );
-
- p_container->setInputItem( p_input_item );
- _buildPlaylist( p_container, p_new_node );
- }
-
- for ( unsigned int i = 0; i < p_parent->getNumItems(); i++ )
- {
- Item* p_item = p_parent->getItem( i );
-
- input_item_t* p_input_item = input_item_NewExt( p_item->getResource(),
- p_item->getTitle(),
- 0,
- NULL,
- 0,
- p_item->getDuration() );
-
- assert( p_input_item );
- input_item_node_AppendItem( p_input_node, p_input_item );
- p_item->setInputItem( p_input_item );
- }
-
- if( b_send )
- input_item_node_PostAndDelete( p_input_node );
-}
-
-void MediaServer::setInputItem( input_item_t* p_input_item )
-{
- if( _p_input_item == p_input_item )
- return;
-
- if( _p_input_item )
- vlc_gc_decref( _p_input_item );
-
- vlc_gc_incref( p_input_item );
- _p_input_item = p_input_item;
-}
-
-input_item_t* MediaServer::getInputItem() const