Changeset f60a8c729f19447d9982c769a3cc95eef383d9c3

Show
Ignore:
Timestamp:
15/07/08 19:38:51 (4 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1216143531 +0200
git-parent:

[9399329f8c097eb2356ee42d8896e0261283cc2f]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1216143531 +0200
Message:

services_discovery: Don't forget a PL_LOCK.

Spotted by 3af47f42e2ac5cfd6ab35bee5320788270a10a29 and ivoire.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/playlist/services_discovery.c

    r115d054 rf60a8c7  
    215215    const char * psz_cat = p_event->u.services_discovery_item_added.psz_category; 
    216216    playlist_item_t *p_new_item, * p_parent = user_data; 
    217  
    218     msg_Dbg( p_parent->p_playlist, "Adding %s in %s", 
     217    playlist_t * p_playlist = p_parent->p_playlist; 
     218 
     219    msg_Dbg( p_playlist, "Adding %s in %s", 
    219220                p_input->psz_name ? p_input->psz_name : "(null)", 
    220221                psz_cat ? psz_cat : "(null)" ); 
    221222 
     223    PL_LOCK; 
    222224    /* If p_parent is in root category (this is clearly a hack) and we have a cat */ 
    223225    if( !EMPTY_STR(psz_cat) && 
    224         p_parent->p_parent == p_parent->p_playlist->p_root_category ) 
     226        p_parent->p_parent == p_playlist->p_root_category ) 
    225227    { 
    226228        /* */ 
     
    229231        if( !p_cat ) 
    230232        { 
    231             p_cat = playlist_NodeCreate( p_parent->p_playlist, psz_cat, 
     233            p_cat = playlist_NodeCreate( p_playlist, psz_cat, 
    232234                                         p_parent, 0, NULL ); 
    233235            p_cat->i_flags &= ~PLAYLIST_SKIP_FLAG; 
     
    236238    } 
    237239 
    238     p_new_item = playlist_NodeAddInput( p_parent->p_playlist, p_input, p_parent, 
    239                                         PLAYLIST_APPEND, PLAYLIST_END, false ); 
     240    p_new_item = playlist_NodeAddInput( p_playlist, p_input, p_parent, 
     241                                        PLAYLIST_APPEND, PLAYLIST_END, pl_Locked ); 
    240242    if( p_new_item ) 
    241243    { 
     
    243245        p_new_item->i_flags &= ~PLAYLIST_SAVE_FLAG; 
    244246    } 
     247    PL_UNLOCK; 
    245248} 
    246249