Changeset 2d970fe00efb70717abef135b40df7369858233e
- 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
| r9d8ceda |
r2d970fe |
|
| 179 | 179 | |
|---|
| 180 | 180 | /* Destroy remaining objects */ |
|---|
| 181 | | static void ObjectGarbageCollector( playlist_t *p_playlist ) |
|---|
| | 181 | static void ObjectGarbageCollector( playlist_t *p_playlist, vlc_bool_t b_force ) |
|---|
| 182 | 182 | { |
|---|
| 183 | 183 | vlc_object_t *p_obj; |
|---|
| 184 | 184 | |
|---|
| 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 | } |
|---|
| 192 | 195 | |
|---|
| 193 | 196 | vlc_mutex_lock( &p_playlist->gc_lock ); |
|---|
| … | … | |
| 195 | 198 | FIND_CHILD ) ) ) |
|---|
| 196 | 199 | { |
|---|
| 197 | | if( p_obj->p_parent != (vlc_object_t*)p_playlist ) |
|---|
| | 200 | if( p_obj->p_parent != VLC_OBJECT(p_playlist) ) |
|---|
| 198 | 201 | { |
|---|
| 199 | 202 | vlc_object_release( p_obj ); |
|---|
| … | … | |
| 208 | 211 | FIND_CHILD ) ) ) |
|---|
| 209 | 212 | { |
|---|
| 210 | | if( p_obj->p_parent != (vlc_object_t*)p_playlist ) |
|---|
| | 213 | if( p_obj->p_parent != VLC_OBJECT(p_playlist) ) |
|---|
| 211 | 214 | { |
|---|
| 212 | 215 | vlc_object_release( p_obj ); |
|---|
| … | … | |
| 306 | 309 | { |
|---|
| 307 | 310 | PL_UNLOCK; |
|---|
| 308 | | ObjectGarbageCollector( p_playlist ); |
|---|
| | 311 | ObjectGarbageCollector( p_playlist, VLC_FALSE ); |
|---|
| 309 | 312 | PL_LOCK; |
|---|
| 310 | 313 | } |
|---|
| … | … | |
| 336 | 339 | p_playlist->status.i_status = PLAYLIST_STOPPED; |
|---|
| 337 | 340 | PL_UNLOCK |
|---|
| | 341 | |
|---|
| | 342 | ObjectGarbageCollector( p_playlist, VLC_TRUE ); |
|---|
| 338 | 343 | return; |
|---|
| 339 | 344 | } |
|---|
| … | … | |
| 342 | 347 | else |
|---|
| 343 | 348 | { |
|---|
| | 349 | const vlc_bool_t b_gc_forced = p_playlist->status.i_status != PLAYLIST_STOPPED; |
|---|
| | 350 | |
|---|
| 344 | 351 | p_playlist->status.i_status = PLAYLIST_STOPPED; |
|---|
| 345 | 352 | if( p_playlist->status.p_item && |
|---|
| … | … | |
| 353 | 360 | /* Collect garbage */ |
|---|
| 354 | 361 | PL_UNLOCK; |
|---|
| 355 | | ObjectGarbageCollector( p_playlist ); |
|---|
| | 362 | ObjectGarbageCollector( p_playlist, b_gc_forced ); |
|---|
| 356 | 363 | PL_LOCK; |
|---|
| 357 | 364 | } |
|---|