[vlc-commits] decoder: do not buffer while paused

Rémi Denis-Courmont git at videolan.org
Sat Nov 7 12:13:18 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov  6 17:33:47 2015 +0200| [743ccea78389a3dd2aaa7c4f880fd17a1d034ea4] | committer: Rémi Denis-Courmont

decoder: do not buffer while paused

This works around a deadlock in the ES output. When paused, buffering
cannot be measured since output latency is unknown. Even decoding
latency would be unrepresentative.

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

 src/input/decoder.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index c78e141..339da52 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1452,7 +1452,9 @@ static void *DecoderThread( void *p_data )
 
         if( p_owner->paused && p_owner->frames_countdown == 0 )
         {   /* Wait for resumption from pause */
+            p_owner->b_idle = true;
             vlc_fifo_Wait( p_owner->p_fifo );
+            p_owner->b_idle = false;
             continue;
         }
 
@@ -2110,9 +2112,10 @@ void input_DecoderWait( decoder_t *p_dec )
     while( !p_owner->b_has_data )
     {
         vlc_fifo_Lock( p_owner->p_fifo );
-        if( p_owner->b_idle && vlc_fifo_IsEmpty( p_owner->p_fifo ) )
+        if( p_owner->b_idle
+         && (vlc_fifo_IsEmpty( p_owner->p_fifo ) || p_owner->paused) )
         {
-            msg_Warn( p_dec, "can't wait without data to decode" );
+            msg_Err( p_dec, "buffer deadlock prevented" );
             vlc_fifo_Unlock( p_owner->p_fifo );
             break;
         }



More information about the vlc-commits mailing list