+ msleep( 500 );
+ }
+}
+
+static int UrlsChange( vlc_object_t *p_this, char const *psz_var,
+ vlc_value_t oldval, vlc_value_t newval,
+ void *p_data )
+{
+ VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(oldval);
+ VLC_UNUSED(newval);
+ services_discovery_sys_t *p_sys = (services_discovery_sys_t *)p_data;
+ p_sys->b_update = true;
+ return VLC_SUCCESS;
+}
+
+static void ParseUrls( services_discovery_t *p_sd, char *psz_urls )
+{
+ services_discovery_sys_t *p_sys = p_sd->p_sys;
+ for( ;; )
+ {
+ int i;
+ char *psz_tok = strchr( psz_urls, '|' );
+ if( psz_tok ) *psz_tok = '\0';
+ for( i = 0; i < p_sys->i_urls; i++ )
+ if( !strcmp( psz_urls, p_sys->ppsz_urls[i] ) )
+ break;
+ if( i == p_sys->i_urls )
+ {
+ /* Only add new urls.
+ * FIXME: We don't delete urls which have been removed from
+ * the config since we don't have a way to know which inputs
+ * they spawned */
+ input_item_t *p_input;
+ INSERT_ELEM( p_sys->ppsz_urls, p_sys->i_urls, p_sys->i_urls,
+ strdup( psz_urls ) );
+ p_input = input_ItemNewExt( p_sd, psz_urls,
+ psz_urls, 0, NULL, -1 );
+ input_ItemAddOption( p_input, "demux=podcast" );
+ services_discovery_AddItem( p_sd, p_input, NULL /* no cat */ );
+ INSERT_ELEM( p_sys->pp_input, p_sys->i_input, p_sys->i_input,
+ input_CreateThread( p_sd, p_input ) );
+ }
+ if( psz_tok ) psz_urls = psz_tok+1;
+ else return;