Changeset 2d970fe00efb70717abef135b40df7369858233e

Show
Ignore:
Timestamp:
10/06/07 21:22:39 (1 year ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1181503359 +0000
git-parent:

[ac58631713d89a822c3d9b2f9f69782209a459c3]

git-author:
Laurent Aimar <fenrir@videolan.org> 1181503359 +0000
Message:

Call garbage collector (vout/sout) when playlist enter stop state (on
user stop or end of playlist).

Files:

Legend:

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

    r9d8ceda r2d970fe  
    179179 
    180180/* Destroy remaining objects */ 
    181 static void ObjectGarbageCollector( playlist_t *p_playlist
     181static void ObjectGarbageCollector( playlist_t *p_playlist, vlc_bool_t b_force
    182182{ 
    183183    vlc_object_t *p_obj; 
    184184 
    185     if( mdate() - p_playlist->gc_date < 1000000 ) 
    186     { 
    187         p_playlist->b_cant_sleep = VLC_TRUE; 
    188         return; 
    189     } 
    190     else if( p_playlist->gc_date == 0 ) 
    191         return; 
     185    if( !b_force ) 
     186    { 
     187        if( mdate() - p_playlist->gc_date < 1000000 ) 
     188        { 
     189            p_playlist->b_cant_sleep = VLC_TRUE; 
     190            return; 
     191        } 
     192        else if( p_playlist->gc_date == 0 ) 
     193            return; 
     194    } 
    192195 
    193196    vlc_mutex_lock( &p_playlist->gc_lock ); 
     
    195198                                                  FIND_CHILD ) ) ) 
    196199    { 
    197         if( p_obj->p_parent != (vlc_object_t*)p_playlist
     200        if( p_obj->p_parent != VLC_OBJECT(p_playlist)
    198201        { 
    199202            vlc_object_release( p_obj ); 
     
    208211                                                  FIND_CHILD ) ) ) 
    209212    { 
    210         if( p_obj->p_parent != (vlc_object_t*)p_playlist
     213        if( p_obj->p_parent != VLC_OBJECT(p_playlist)
    211214        { 
    212215            vlc_object_release( p_obj ); 
     
    306309        { 
    307310            PL_UNLOCK; 
    308             ObjectGarbageCollector( p_playlist ); 
     311            ObjectGarbageCollector( p_playlist, VLC_FALSE ); 
    309312            PL_LOCK; 
    310313        } 
     
    336339                p_playlist->status.i_status = PLAYLIST_STOPPED; 
    337340                PL_UNLOCK 
     341 
     342                ObjectGarbageCollector( p_playlist, VLC_TRUE ); 
    338343                return; 
    339344             } 
     
    342347         else 
    343348         { 
     349            const vlc_bool_t b_gc_forced = p_playlist->status.i_status != PLAYLIST_STOPPED; 
     350 
    344351            p_playlist->status.i_status = PLAYLIST_STOPPED; 
    345352            if( p_playlist->status.p_item && 
     
    353360            /* Collect garbage */ 
    354361            PL_UNLOCK; 
    355             ObjectGarbageCollector( p_playlist ); 
     362            ObjectGarbageCollector( p_playlist, b_gc_forced ); 
    356363            PL_LOCK; 
    357364        }