- char *psz_mrl = malloc( strlen( SHOUTCAST_BASE_URL )
- + strlen( "?genre=" ) + strlen( psz_name ) + 1 );
- sprintf( psz_mrl, SHOUTCAST_BASE_URL "?genre=%s",
- psz_name );
- p_input = input_ItemNewExt( p_sys->p_playlist, psz_mrl,
- psz_name, 0, NULL, -1 );
- input_ItemCopyOptions( p_sys->p_current->p_input,
- p_input );
- free( psz_mrl );
- playlist_BothAddInput( p_sys->p_playlist, p_input,
- p_sys->p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ char* psz_mrl;
+
+ if( asprintf( &psz_mrl, SHOUTCAST_BASE_URL "?genre=%s",
+ psz_name ) != -1 )
+ {
+ input_item_t *p_input;
+ p_input = input_item_New( psz_mrl, psz_name );
+ input_item_CopyOptions( p_input_node->p_item, p_input );
+ free( psz_mrl );
+ input_item_node_AppendItem( p_input_node, p_input );
+ vlc_gc_decref( p_input );
+ }