[vlc-devel] commit: Try to interrupt fetcher thread as soon as possible. ( Laurent Aimar )

git version control git at videolan.org
Tue Mar 10 00:01:49 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Mar  9 23:50:45 2009 +0100| [15973bcd1b706c7aecd8ee3ff3a75c0796d950e3] | committer: Laurent Aimar 

Try to interrupt fetcher thread as soon as possible.

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

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

diff --git a/src/playlist/fetcher.c b/src/playlist/fetcher.c
index a35b732..787e400 100644
--- a/src/playlist/fetcher.c
+++ b/src/playlist/fetcher.c
@@ -101,6 +101,9 @@ void playlist_fetcher_Push( playlist_fetcher_t *p_fetcher, input_item_t *p_item
 
 void playlist_fetcher_Delete( playlist_fetcher_t *p_fetcher )
 {
+    /* */
+    vlc_object_kill( p_fetcher );
+
     /* Destroy the item meta-infos fetcher */
     vlc_cancel( p_fetcher->thread );
     vlc_join( p_fetcher->thread, NULL );
@@ -396,8 +399,17 @@ static void *Thread( void *p_data )
         /* Wait that the input item is preparsed if it is being played */
         WaitPreparsed( p_fetcher, p_item );
 
+        /* */
+        if( !vlc_object_alive( p_fetcher ) )
+            goto end;
+
         /* Find art, and download it if needed */
         int i_ret = FindArt( p_fetcher, p_item );
+
+        /* */
+        if( !vlc_object_alive( p_fetcher ) )
+            goto end;
+
         if( i_ret == 1 )
             i_ret = DownloadArt( p_fetcher, p_item );
 
@@ -415,6 +427,8 @@ static void *Thread( void *p_data )
             input_item_SetArtNotFound( p_item, true );
         }
         free( psz_name );
+
+    end:
         vlc_gc_decref( p_item );
 
         vlc_restorecancel( canc );




More information about the vlc-devel mailing list