]> git.sesse.net Git - mlt/blobdiff - src/modules/core/producer_colour.c
Add service locks for parallelism.
[mlt] / src / modules / core / producer_colour.c
index a43adedaadc21f351ac174f030fe3fed85526660..8667e4534684849b6b88283d6897dfdde5d3403c 100644 (file)
@@ -99,6 +99,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        // Obtain the producer for this frame
        mlt_producer producer = mlt_properties_get_data( properties, "producer_colour", NULL );
 
+       mlt_service_lock( MLT_PRODUCER_SERVICE( producer ) );
+
        // Obtain properties of producer
        mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
 
@@ -154,6 +156,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                mlt_properties_set_int( producer_props, "_format", *format );
                mlt_properties_set( producer_props, "_resource", now );
 
+               mlt_service_unlock( MLT_PRODUCER_SERVICE( producer ) );
+
                switch ( *format )
                {
                case mlt_image_yuv422:
@@ -204,6 +208,10 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                        break;
                }
        }
+       else
+       {
+               mlt_service_unlock( MLT_PRODUCER_SERVICE( producer ) );
+       }
 
        // Create the alpha channel
        int alpha_size = *width * *height;