Changeset 59198c7ddb54e2193636425475ba46b09b135264

Show
Ignore:
Timestamp:
03/10/07 02:35:13 (1 year ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1191371713 +0000
git-parent:

[2f9a9c57a553cad6a9cba042638044a32593aed3]

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

playlist: fix media library loading, fix #1320.

Files:

Legend:

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

    r5b093e3 r59198c7  
    2323#include <vlc/vlc.h> 
    2424#include <vlc_playlist.h> 
     25#include <vlc_events.h> 
    2526#include "playlist_internal.h" 
    2627#include "modules/configuration.h" 
     
    8889} 
    8990 
     91/***************************************************************************** 
     92 * A subitem has been added to the Media Library (Event Callback) 
     93 *****************************************************************************/ 
     94static void input_item_subitem_added( const vlc_event_t * p_event, 
     95                                      void * user_data ) 
     96{ 
     97    playlist_t *p_playlist = user_data; 
     98    input_item_t *p_item = p_event->u.input_item_subitem_added.p_new_child; 
     99    playlist_AddInput( p_playlist, p_item, PLAYLIST_APPEND, PLAYLIST_END, 
     100            VLC_FALSE, VLC_FALSE ); 
     101} 
     102 
    90103int playlist_MLLoad( playlist_t *p_playlist ) 
    91104{ 
     
    128141        goto error; 
    129142 
    130     /* FIXME [21574] pdherbemont do we need *install_input_item_observer ? */ 
    131     playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, 0, VLC_FALSE, 
    132                         VLC_FALSE ); 
     143    p_playlist->p_ml_onelevel->p_input = 
     144    p_playlist->p_ml_category->p_input = p_input; 
     145 
     146    vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemAdded, 
     147                        input_item_subitem_added, p_playlist ); 
    133148 
    134149    p_playlist->b_doing_ml = VLC_TRUE; 
     
    137152    stats_TimerStop( p_playlist,STATS_TIMER_ML_LOAD ); 
    138153    p_playlist->b_doing_ml = VLC_FALSE; 
     154 
     155    vlc_event_detach( &p_input->event_manager, vlc_InputItemSubItemAdded, 
     156                        input_item_subitem_added, p_playlist ); 
    139157 
    140158    free( psz_uri );