]> git.sesse.net Git - vlc/commitdiff
Fixed a potential deadlock.
authorLaurent Aimar <fenrir@videolan.org>
Wed, 8 Oct 2008 19:38:55 +0000 (21:38 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 8 Oct 2008 22:11:16 +0000 (00:11 +0200)
src/input/decoder.c
src/input/es_out.c

index 41f79b0d09a3c324f2a889ab4b15ee83a4c29e14..b63d26cac8f7c3071526ce023998752fc4df25b5 100644 (file)
@@ -394,8 +394,8 @@ void input_DecoderDecode( decoder_t * p_dec, block_t *p_block )
 
 bool input_DecoderIsEmpty( decoder_t * p_dec )
 {
-    /* FIXME it is buggy if the decoder is buffering FIXME
-     * -> "deadlock" */
+    assert( !p_dec->p_owner->b_buffering );
+
     if( p_dec->p_owner->b_own_thread &&
         block_FifoCount( p_dec->p_owner->p_fifo ) > 0 )
     {
index 4c6573ba227f45bfd5080416b90ffe4c2eac872d..a07832335849b368b17416c6fbbece545dc43f97 100644 (file)
@@ -1737,7 +1737,7 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
     /* We don't try to reselect */
     if( es->p_dec )
     {
-        while( !out->p_sys->p_input->b_die && es->p_dec )
+        while( !p_sys->p_input->b_die && !p_sys->b_buffering && es->p_dec )
         {
             if( input_DecoderIsEmpty( es->p_dec ) &&
                 ( !es->p_dec_record || input_DecoderIsEmpty( es->p_dec_record ) ))