[vlc-devel] commit: motionblur: fix race condition. ( Rémi Duraffort )

git version control git at videolan.org
Tue Oct 20 22:11:16 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Oct 20 21:38:59 2009 +0200| [d9b829de55be677a7e73acc27a4287c604ef50c0] | committer: Rémi Duraffort 

motionblur: fix race condition.

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

 modules/video_filter/motionblur.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/video_filter/motionblur.c b/modules/video_filter/motionblur.c
index f5e4340..aad8946 100644
--- a/modules/video_filter/motionblur.c
+++ b/modules/video_filter/motionblur.c
@@ -178,8 +178,11 @@ static void RenderBlur( filter_sys_t *p_sys, picture_t *p_newpic,
                         picture_t *p_outpic )
 {
     int i_plane;
-    int i_oldfactor = p_sys->i_factor;
+    vlc_spin_lock( &p_sys->lock );
+    const int i_oldfactor = p_sys->i_factor;
+    vlc_spin_unlock( &p_sys->lock );
     int i_newfactor = 128 - i_oldfactor;
+
     for( i_plane = 0; i_plane < p_outpic->i_planes; i_plane++ )
     {
         uint8_t *p_old, *p_new, *p_out, *p_out_end, *p_out_line_end;




More information about the vlc-devel mailing list