[vlc-devel] commit: playlist: Don't accept more items when if preparser is dead. ( Pierre d'Herbemont )

git version control git at videolan.org
Sun Jul 13 23:56:42 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jul 13 23:14:31 2008 +0200| [54a51559031f6f81dcfcb41bd889201264750db7]

playlist: Don't accept more items when if preparser is dead.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=54a51559031f6f81dcfcb41bd889201264750db7
---

 src/playlist/control.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/playlist/control.c b/src/playlist/control.c
index 5bf66f6..8f3e48a 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -181,6 +181,11 @@ int playlist_PreparseEnqueue( playlist_t *p_playlist,
                               input_item_t *p_item )
 {
     vlc_object_lock( p_playlist->p_preparse );
+    if( !vlc_object_alive( p_playlist->p_preparse ) )
+    {
+        vlc_object_unlock( p_playlist->p_preparse );
+        return VLC_EGENERIC;
+    }
     vlc_gc_incref( p_item );
     INSERT_ELEM( p_playlist->p_preparse->pp_waiting,
                  p_playlist->p_preparse->i_waiting,
@@ -198,6 +203,12 @@ int playlist_PreparseEnqueueItem( playlist_t *p_playlist,
 {
     vlc_object_lock( p_playlist );
     vlc_object_lock( p_playlist->p_preparse );
+    if( !vlc_object_alive( p_playlist->p_preparse ) )
+    {
+        vlc_object_unlock( p_playlist->p_preparse );
+        vlc_object_unlock( p_playlist );
+        return VLC_EGENERIC;
+    }
     PreparseEnqueueItemSub( p_playlist, p_item );
     vlc_object_unlock( p_playlist->p_preparse );
     vlc_object_unlock( p_playlist );
@@ -210,6 +221,12 @@ int playlist_AskForArtEnqueue( playlist_t *p_playlist,
     int i;
 
     vlc_object_lock( p_playlist->p_fetcher );
+    if( !vlc_object_alive( p_playlist->p_fetcher ) )
+    {
+        vlc_object_unlock( p_playlist->p_fetcher );
+        return VLC_EGENERIC;
+    }
+
     for( i = 0; i < p_playlist->p_fetcher->i_waiting ; i++ );
     vlc_gc_incref( p_item );
     INSERT_ELEM( p_playlist->p_fetcher->pp_waiting,




More information about the vlc-devel mailing list