- i_limit = config_GetInt( p_this->p_libvlc, "shoutcast-limit" );
- #define SHOUTCAST_BASE_URL "http/shout-b4s://shoutcast.com/sbin/xmllister.phtml?service=vlc&no_compress=1&limit="
- psz_shoutcast_url = (char *)malloc( strlen( SHOUTCAST_BASE_URL ) + 20 );
- psz_shoutcast_title = (char *)malloc( 6 + 20 );
-
- sprintf( psz_shoutcast_url, SHOUTCAST_BASE_URL "%d", i_limit );
- sprintf( psz_shoutcast_title, "Top %d", i_limit );
-
- p_view = playlist_ViewFind( p_playlist, VIEW_CATEGORY );
- p_sys->p_node = playlist_NodeCreate( p_playlist, VIEW_CATEGORY,
- _("Shoutcast"), p_view->p_root );
- p_item = playlist_ItemNew( p_playlist, psz_shoutcast_url,
- psz_shoutcast_title );
- free( psz_shoutcast_url );
- free( psz_shoutcast_title );
- playlist_NodeAddItem( p_playlist, p_item,
- p_sys->p_node->pp_parents[0]->i_view,
- p_sys->p_node, PLAYLIST_APPEND,
- PLAYLIST_END );
-
- /* We need to declare the parents of the node as the same of the
- * parent's ones */
- playlist_CopyParents( p_sys->p_node, p_item );
-
+/*****************************************************************************
+ * CreateInputItemFromShoutItem:
+ *****************************************************************************/
+static input_item_t * CreateInputItemFromShoutItem( services_discovery_t *p_sd,
+ const struct shout_item_t * p_item )
+{
+ int i;
+ /* Create the item */
+ input_item_t *p_input = input_ItemNewExt( p_sd,
+ p_item->psz_url, _(p_item->psz_name),
+ 0, NULL, -1 );
+
+ /* Copy options */
+ for( i = 0; p_item->ppsz_options[i] != NULL; i++ )
+ input_ItemAddOption( p_input, p_item->ppsz_options[i] );
+ input_ItemAddOption( p_input, "no-playlist-autostart" );
+
+ return p_input;
+}