]> git.sesse.net Git - vlc/commitdiff
Fast decoder thread cancellation.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 22 Dec 2008 18:47:26 +0000 (19:47 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 5 Jan 2009 19:49:10 +0000 (20:49 +0100)
src/input/decoder.c

index 789a724cf1c36a5b78e8f170f57358c3e6fb252f..eeadefaf13dc00b2bdb180a539b0cf0fbedf011a 100644 (file)
@@ -862,6 +862,7 @@ static void *DecoderThread( vlc_object_t *p_this )
     for( ;; )
     {
         block_t *p_block = block_FifoGet( p_owner->p_fifo );
+
         /* Make sure there is no cancellation point other than this one^^.
          * If you need one, be sure to push cleanup of p_block. */
         DecoderSignalBuffering( p_dec, p_block == NULL );
@@ -877,9 +878,9 @@ static void *DecoderThread( vlc_object_t *p_this )
 
             vlc_restorecancel( canc );
         }
+        /* Ensure fast cancellation in case the fifo is not empty */
+        vlc_testcancel();
     }
-
-    DecoderSignalBuffering( p_dec, true );
     return NULL;
 }