]> git.sesse.net Git - vlc/commitdiff
Fix vout/sout garbage collection and input spam debug messages
authorClément Stenac <zorglub@videolan.org>
Thu, 8 Jun 2006 18:59:14 +0000 (18:59 +0000)
committerClément Stenac <zorglub@videolan.org>
Thu, 8 Jun 2006 18:59:14 +0000 (18:59 +0000)
include/vlc_playlist.h
src/playlist/engine.c

index fe53dd5848225bed622980160526aa04454265f2..a13a03eda0c55ad761b32416cf02c4bd38645025 100644 (file)
@@ -142,6 +142,9 @@ struct playlist_t
     services_discovery_t **pp_sds;
     int                   i_sds;
 
+    mtime_t    i_vout_destroyed_date;
+    mtime_t    i_sout_destroyed_date;
+
     struct {
         /* Current status. These fields are readonly, only the playlist
          * main loop can touch it*/
index a094dbb42616520f813773a28884d00d91c7ac59..87ad67cb2d22a1d627a5b028c4e213a6e8cbdcbe 100644 (file)
@@ -60,6 +60,9 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
     p_playlist->i_last_input_id = 0;
     p_playlist->p_input = NULL;
 
+    p_playlist->i_vout_destroyed_date = 0;
+    p_playlist->i_sout_destroyed_date = 0;
+
     p_playlist->i_size = 0;
     p_playlist->pp_items = NULL;
     p_playlist->i_all_size = 0;
@@ -181,8 +184,6 @@ void playlist_MainLoop( playlist_t *p_playlist )
 {
     playlist_item_t *p_item = NULL;
 
-    mtime_t    i_vout_destroyed_date = 0;
-    mtime_t    i_sout_destroyed_date = 0;
 
     PL_LOCK
 
@@ -190,6 +191,8 @@ void playlist_MainLoop( playlist_t *p_playlist )
     /* FIXME : this can be called several times */
     if( p_playlist->request.b_request )
     {
+        if( p_playlist->request.i_status == PLAYLIST_STOPPED )
+            p_playlist->request.b_request = VLC_FALSE ;
         PL_DEBUG( "incoming request - stopping current input" );
         /* Stop the existing input */
         if( p_playlist->p_input )
@@ -224,8 +227,8 @@ void playlist_MainLoop( playlist_t *p_playlist )
             /* Destroy object */
             vlc_object_destroy( p_input );
 
-            i_vout_destroyed_date = 0;
-            i_sout_destroyed_date = 0;
+            p_playlist->i_vout_destroyed_date = 0;
+            p_playlist->i_sout_destroyed_date = 0;
 
             if( p_playlist->status.p_item->i_flags
                 & PLAYLIST_REMOVE_FLAG )
@@ -259,12 +262,12 @@ void playlist_MainLoop( playlist_t *p_playlist )
         else if( p_playlist->p_input->i_state != INIT_S )
         {
             PL_UNLOCK
-            i_vout_destroyed_date =
+            p_playlist->i_vout_destroyed_date =
                 ObjectGarbageCollector( p_playlist, VLC_OBJECT_VOUT,
-                                        i_vout_destroyed_date );
-            i_sout_destroyed_date =
+                                        p_playlist->i_vout_destroyed_date );
+            p_playlist->i_sout_destroyed_date =
                 ObjectGarbageCollector( p_playlist, VLC_OBJECT_SOUT,
-                                        i_sout_destroyed_date );
+                                        p_playlist->i_sout_destroyed_date );
             PL_LOCK
         }
     }
@@ -307,9 +310,9 @@ void playlist_MainLoop( playlist_t *p_playlist )
 
              /* Collect garbage */
              PL_UNLOCK
-             i_sout_destroyed_date =
+             p_playlist->i_sout_destroyed_date =
              ObjectGarbageCollector( p_playlist, VLC_OBJECT_SOUT, mdate() );
-             i_vout_destroyed_date =
+             p_playlist->i_vout_destroyed_date =
              ObjectGarbageCollector( p_playlist, VLC_OBJECT_VOUT, mdate() );
              PL_LOCK
          }