[vlc-devel] commit: upnp_intel: new playlist design (Jakob Leben )
git version control
git at videolan.org
Tue Feb 2 06:56:59 CET 2010
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Tue Feb 2 04:22:47 2010 +0100| [6b18cf4cc76a1275bfc9a731f33eea0cdc374cdd] | committer: Jakob Leben
upnp_intel: new playlist design
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6b18cf4cc76a1275bfc9a731f33eea0cdc374cdd
---
modules/services_discovery/upnp_intel.cpp | 19 ++++++++++++++++---
modules/services_discovery/upnp_intel.hpp | 2 +-
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/modules/services_discovery/upnp_intel.cpp b/modules/services_discovery/upnp_intel.cpp
index 6ea48cf..382bcee 100644
--- a/modules/services_discovery/upnp_intel.cpp
+++ b/modules/services_discovery/upnp_intel.cpp
@@ -659,7 +659,7 @@ void MediaServer::fetchContents()
_contents = root;
_contents->setInputItem( _inputItem );
- _buildPlaylist( _contents );
+ _buildPlaylist( _contents, NULL );
}
bool MediaServer::_fetchContents( Container* parent )
@@ -780,17 +780,23 @@ bool MediaServer::_fetchContents( Container* parent )
return true;
}
-void MediaServer::_buildPlaylist( Container* parent )
+void MediaServer::_buildPlaylist( Container* parent, input_item_node_t *p_input_node )
{
+ bool send = p_input_node == NULL;
+ if( send )
+ p_input_node = input_item_node_Create( parent->getInputItem() );
+
for ( unsigned int i = 0; i < parent->getNumContainers(); i++ )
{
Container* container = parent->getContainer( i );
input_item_t* p_input_item = input_item_New( _p_sd, "vlc://nop", parent->getTitle() );
input_item_AddSubItem( parent->getInputItem(), p_input_item );
+ input_item_node_t *p_new_node =
+ input_item_node_AppendItem( p_input_node, p_input_item );
container->setInputItem( p_input_item );
- _buildPlaylist( container );
+ _buildPlaylist( container, p_new_node );
}
for ( unsigned int i = 0; i < parent->getNumItems(); i++ )
@@ -802,8 +808,15 @@ void MediaServer::_buildPlaylist( Container* parent )
item->getTitle() );
assert( p_input_item );
input_item_AddSubItem( parent->getInputItem(), p_input_item );
+ input_item_node_AppendItem( p_input_node, p_input_item );
item->setInputItem( p_input_item );
}
+
+ if( send )
+ {
+ input_item_AddSubItemTree( p_input_node );
+ input_item_node_Delete( p_input_node );
+ }
}
void MediaServer::setInputItem( input_item_t* p_input_item )
diff --git a/modules/services_discovery/upnp_intel.hpp b/modules/services_discovery/upnp_intel.hpp
index b699641..c571e8d 100644
--- a/modules/services_discovery/upnp_intel.hpp
+++ b/modules/services_discovery/upnp_intel.hpp
@@ -69,7 +69,7 @@ public:
private:
bool _fetchContents( Container* parent );
- void _buildPlaylist( Container* container );
+ void _buildPlaylist( Container* container, input_item_node_t * );
IXML_Document* _browseAction( const char*, const char*,
const char*, const char*, const char*, const char* );
More information about the vlc-devel
mailing list