Fixed decoder deadlock when stream output control the pace.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 20 Nov 2008 18:04:09 +0000 (19:04 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 20 Nov 2008 18:04:09 +0000 (19:04 +0100)
src/input/decoder.c

index 87d5dc8..1421367 100644 (file)
@@ -370,7 +370,12 @@ void input_DecoderDecode( decoder_t *p_dec, block_t *p_block )
 
     if( p_owner->p_input->p->b_out_pace_control )
     {
-        block_FifoPace( p_owner->p_fifo, 10, SIZE_MAX );
+        /* The fifo is not consummed when buffering and so will
+         * deadlock vlc.
+         * There is no need to lock as b_buffering is never modify
+         * inside decoder thread. */
+        if( !p_owner->b_buffering )
+            block_FifoPace( p_owner->p_fifo, 10, SIZE_MAX );
     }
     else if( block_FifoSize( p_owner->p_fifo ) > 50000000 /* 50 MB */ )
     {