[vlc-devel] commit: Alpha mask: thread-safety ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue May 19 19:59:17 CEST 2009


vlc | branch: 1.0-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Tue May 19 19:49:37 2009 +0300| [01a0090145440f5c5da29c88b482594f8972c835] | committer: Rémi Denis-Courmont 

Alpha mask: thread-safety

A corner case occured if the mask were changed during initialization.

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

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

diff --git a/modules/video_filter/alphamask.c b/modules/video_filter/alphamask.c
index 79999cd..af46bd7 100644
--- a/modules/video_filter/alphamask.c
+++ b/modules/video_filter/alphamask.c
@@ -108,11 +108,6 @@ static int Create( vlc_object_t *p_this )
     config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
                        p_filter->p_cfg );
 
-    vlc_mutex_init( &p_sys->mask_lock );
-    psz_string =
-        var_CreateGetStringCommand( p_filter, CFG_PREFIX "mask" );
-    var_AddCallback( p_filter, CFG_PREFIX "mask", MaskCallback,
-                     p_filter );
     p_sys->p_mask = NULL;
     if( psz_string && *psz_string )
     {
@@ -123,6 +118,11 @@ static int Create( vlc_object_t *p_this )
     }
     free( psz_string );
 
+    vlc_mutex_init( &p_sys->mask_lock );
+    psz_string =
+        var_CreateGetStringCommand( p_filter, CFG_PREFIX "mask" );
+    var_AddCallback( p_filter, CFG_PREFIX "mask", MaskCallback,
+                     p_filter );
     p_filter->pf_video_filter = Filter;
 
     return VLC_SUCCESS;




More information about the vlc-devel mailing list