Changeset 3828287d44a29e2cbdae01aca3946bcc34c012e2

Show
Ignore:
Timestamp:
11/12/07 14:36:09 (10 months ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1194874569 +0000
git-parent:

[72757e9340c0d3a64760349a06fbc7aa47ba0417]

git-author:
Rafaël Carré <funman@videolan.org> 1194874569 +0000
Message:

services_discovery_SetLocalizedName() is now mandatory. Fix #1344
upnp_intel module still has to be rewritten (it will crash at runtime)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/services_discovery/shout.c

    r6f17ad3 r3828287  
    125125    { 
    126126        case TV: 
     127            services_discovery_SetLocalizedName( p_sd, _("Shoutcast TV") ); 
     128 
    127129            p_sys->p_input = input_ItemNewExt( p_sd, 
    128130                                SHOUTCAST_TV_BASE_URL, _("Shoutcast TV"), 
     
    131133        case RADIO: 
    132134        default: 
     135            services_discovery_SetLocalizedName( p_sd, _("Shoutcast Radio") ); 
     136 
    133137            p_sys->p_input = input_ItemNewExt( p_sd, 
    134138                                SHOUTCAST_BASE_URL, _("Shoutcast Radio"), 
     
    141145 
    142146/***************************************************************************** 
     147 * ItemAdded: 
     148 *****************************************************************************/ 
     149static void ItemAdded( const vlc_event_t * p_event, void * user_data ) 
     150{ 
     151    services_discovery_t *p_sd = user_data; 
     152    services_discovery_AddItem( p_sd, 
     153            p_event->u.input_item_subitem_added.p_new_child, 
     154            NULL /* no category */ ); 
     155} 
     156 
     157/***************************************************************************** 
    143158 * Run: 
    144159 *****************************************************************************/ 
    145160static void Run( services_discovery_t *p_sd ) 
    146161{ 
    147     p_sd->p_sys->p_input->b_prefers_tree = VLC_TRUE; 
    148     services_discovery_AddItem( p_sd, p_sd->p_sys->p_input, NULL /* no category */ ); 
    149  
    150     input_Read( p_sd, p_sd->p_sys->p_input, VLC_FALSE ); 
     162    vlc_event_attach( &p_sd->p_sys->p_input->event_manager, vlc_InputItemSubItemAdded, ItemAdded, p_sd ); 
     163    input_Read( p_sd, p_sd->p_sys->p_input, VLC_TRUE ); 
     164    vlc_event_detach( &p_sd->p_sys->p_input->event_manager, vlc_InputItemSubItemAdded, ItemAdded, p_sd ); 
    151165} 
    152166 
     
    158172    services_discovery_t *p_sd = ( services_discovery_t* )p_this; 
    159173    services_discovery_sys_t *p_sys  = p_sd->p_sys; 
    160     services_discovery_RemoveItem( p_sd, p_sys->p_input ); 
    161174    free( p_sys ); 
    162175} 
  • src/playlist/services_discovery.c

    racbd355 r3828287  
    283283 
    284284        char * psz = services_discovery_GetLocalizedName( p_sd ); 
    285         if( psz ) 
    286         { 
    287             playlist_NodesPairCreate( p_playlist, psz, 
    288                     &p_cat, &p_one, VLC_FALSE ); 
    289             free( psz ); 
    290         } 
    291         else 
    292         { 
    293             /* No name, just add at the top of the playlist */ 
    294             PL_LOCK; 
    295             p_cat = p_playlist->p_root_category; 
    296             p_one = p_playlist->p_root_onelevel; 
    297             PL_UNLOCK; 
    298         } 
     285        assert( psz ); 
     286        playlist_NodesPairCreate( p_playlist, psz, 
     287                &p_cat, &p_one, VLC_FALSE ); 
     288        free( psz ); 
    299289 
    300290        vlc_event_attach( services_discovery_EventManager( p_sd ),