[vlc-devel] commit: Fixed potential race condition on vout release in decoder. ( Laurent Aimar )

git version control git at videolan.org
Tue Sep 30 22:30:58 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Sep 28 15:39:07 2008 +0200| [bf56c2bd61fa24b0f4d2aef1fdae9eda84d6752a] | committer: Laurent Aimar 

Fixed potential race condition on vout release in decoder.

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

 src/input/decoder.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 5d3e86b..f239b62 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1559,8 +1559,12 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
         p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
         p_owner->video = p_dec->fmt_out.video;
 
-        p_vout = vout_Request( p_dec, p_owner->p_vout,
-                               &p_dec->fmt_out.video );
+        vlc_mutex_lock( &p_owner->lock );
+        p_vout = p_owner->p_vout;
+        p_owner->p_vout = NULL;
+        vlc_mutex_unlock( &p_owner->lock );
+
+        p_vout = vout_Request( p_dec, p_vout, &p_dec->fmt_out.video );
 
         vlc_mutex_lock( &p_owner->lock );
         p_owner->p_vout = p_vout;




More information about the vlc-devel mailing list