Commit c6cce792 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Cumulated UPnP fixes from Christian Henz

parent 75f2ed95
...@@ -28,6 +28,7 @@ Bruno Vella <allevb at tin.it> - Italian localization ...@@ -28,6 +28,7 @@ Bruno Vella <allevb at tin.it> - Italian localization
Carlo Calabrò <murray at via.ecp.fr> - Italian localization Carlo Calabrò <murray at via.ecp.fr> - Italian localization
Carsten Gottbehüt <gottbehuet at active-elements dot de> - v4l hotplug fix Carsten Gottbehüt <gottbehuet at active-elements dot de> - v4l hotplug fix
Chris Clepper - OpenGL fix Chris Clepper - OpenGL fix
Christian Henz - UPnP service discovery fixes
Christof Baumgaertner - dbox web intf Christof Baumgaertner - dbox web intf
Christophe Mutricy <xtophe at nxtelevision dot com> - many fixes (preferences, M3U, ...) Christophe Mutricy <xtophe at nxtelevision dot com> - many fixes (preferences, M3U, ...)
Christopher Johnson <cjohnson at mint.net> - Qt fix in vlc.spec Christopher Johnson <cjohnson at mint.net> - Qt fix in vlc.spec
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* upnp.cpp : UPnP discovery module * upnp.cpp : UPnP discovery module
***************************************************************************** *****************************************************************************
* Copyright (C) 2004-2005 the VideoLAN team * Copyright (C) 2004-2005 the VideoLAN team
* $Id: sap.c 11664 2005-07-09 06:17:09Z courmisch $ * $Id$
* *
* Authors: Rémi Denis-Courmont <rem # videolan.org> * Authors: Rémi Denis-Courmont <rem # videolan.org>
* *
...@@ -257,27 +257,30 @@ void UPnPHandler::AddContent( playlist_item_t *p_parent, ContentNode *node ) ...@@ -257,27 +257,30 @@ void UPnPHandler::AddContent( playlist_item_t *p_parent, ContentNode *node )
msg_Dbg( p_sd, "title = %s", title ); msg_Dbg( p_sd, "title = %s", title );
if( !node->isContainerNode() ) if ( node->isItemNode() )
{ {
msg_Dbg( p_sd, "not a container" );
return;
}
ContainerNode *conNode = (ContainerNode *)node;
ItemNode *iNode = (ItemNode *)node; ItemNode *iNode = (ItemNode *)node;
playlist_item_t *p_item; playlist_item_t *p_item;
p_item = playlist_ItemNew( p_sd, iNode->getResource(), title ); p_item = playlist_ItemNew( p_sd, iNode->getResource(), title );
playlist_NodeAddItem( p_sys->p_playlist, p_item, VIEW_CATEGORY, playlist_NodeAddItem( p_sys->p_playlist, p_item, VIEW_CATEGORY,
p_parent, PLAYLIST_APPEND, PLAYLIST_END ); p_parent, PLAYLIST_APPEND, PLAYLIST_END );
/*if( !cnode->hasContainerNodes() ) } else if ( node->isContainerNode() )
return;*/ {
ContainerNode *conNode = (ContainerNode *)node;
char* p_name = strdup(title); /* See other comment on strdup */
playlist_item_t* p_node = playlist_NodeCreate( p_sys->p_playlist, VIEW_CATEGORY,
p_name, p_parent );
free(p_name);
unsigned nContentNodes = conNode->getNContentNodes(); unsigned nContentNodes = conNode->getNContentNodes();
for( unsigned n = 0; n < nContentNodes; n++ ) for( unsigned n = 0; n < nContentNodes; n++ )
AddContent( p_item, conNode->getContentNode( n ) ); AddContent( p_node, conNode->getContentNode( n ) );
}
} }
...@@ -316,10 +319,12 @@ void UPnPHandler::deviceSearchResponseReceived( SSDPPacket *packet ) ...@@ -316,10 +319,12 @@ void UPnPHandler::deviceSearchResponseReceived( SSDPPacket *packet )
packet->getNTS( nts ); packet->getNTS( nts );
udn = usn.substr( 0, usn.find( "::" ) ); udn = usn.substr( 0, usn.find( "::" ) );
/* Remove existing root device before adding updated one */
Device *dev = GetDeviceFromUSN( usn ); Device *dev = GetDeviceFromUSN( usn );
if( packet->isByeBye() )
RemoveDevice( dev ); RemoveDevice( dev );
else
if( !packet->isByeBye() )
AddDeviceContent( dev ); AddDeviceContent( dev );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment