]> git.sesse.net Git - mlt/blobdiff - src/modules/effectv/filter_burn.c
Add service locks for parallelism.
[mlt] / src / modules / effectv / filter_burn.c
index 42a1f2d877d777ba28199ae42c8ac6d9a9ab0870..aefa76cf119b9bf081085ad929ad72a450fb10a1 100644 (file)
@@ -103,8 +103,9 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                unsigned char v, w;
                RGB32 a, b;
 
-               diff = mlt_properties_get_data( MLT_FILTER_PROPERTIES( filter ), 
-                                               "_diff", NULL );
+               mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
+               diff = mlt_properties_get_data( MLT_FILTER_PROPERTIES( filter ), "_diff", NULL );
                if (diff == NULL)
                {
                        diff = mlt_pool_alloc(video_area*sizeof(unsigned char));
@@ -112,8 +113,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                                        diff, video_area*sizeof(unsigned char), mlt_pool_release, NULL );
                }
 
-               buffer = mlt_properties_get_data( MLT_FILTER_PROPERTIES( filter ), 
-                                               "_buffer", NULL );
+               buffer = mlt_properties_get_data( MLT_FILTER_PROPERTIES( filter ), "_buffer", NULL );
                if (buffer == NULL)
                {
                        buffer = mlt_pool_alloc(video_area*sizeof(unsigned char));
@@ -122,7 +122,6 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                                        buffer, video_area*sizeof(unsigned char), mlt_pool_release, NULL );
                }
 
-
                if (burn_foreground == 1) {
                        /* to burn the foreground, we need a background */
                        background = mlt_properties_get_data( MLT_FILTER_PROPERTIES( filter ), 
@@ -136,6 +135,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        }
                }
 
+               mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
+
                if (burn_foreground == 1) {
                        image_bgsubtract_y(diff, background, src, video_area, y_threshold);
                } else {