]> git.sesse.net Git - vlc/commitdiff
decoder: pause aout at creation in corner case (fix #6369)
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 11 Mar 2012 20:58:10 +0000 (22:58 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 11 Mar 2012 20:58:10 +0000 (22:58 +0200)
If pausing the decoder races with setting up the audio output pipeline,
the decoder can end up already paused when the audio output is created.

The audio output insists on a strict start -> (pause -> resume ->)*
(pause ->)? stop series of state transition. So it must be paused
explicitly in this corner case.

I have not investigated whether this problem affects the video output
but this seems very likely too.

src/input/decoder.c

index 52b37bd629f3ae2248ba25bd7b9ee360d88bdc4a..47f27eb44998c727e49d85895f8d94a88a94254e 100644 (file)
@@ -2256,6 +2256,8 @@ static aout_buffer_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
 
         p_owner->p_aout = p_aout;
         DecoderUpdateFormatLocked( p_dec );
+        if( unlikely(p_owner->b_paused) ) /* fake pause if needed */
+            aout_DecChangePause( p_aout, true, mdate() );
 
         vlc_mutex_unlock( &p_owner->lock );