]> git.sesse.net Git - mlt/blobdiff - src/modules/qimage/producer_qimage.c
Refactor to use mlt_frame_set_image/_alpha.
[mlt] / src / modules / qimage / producer_qimage.c
index 9ed5c1eed6339d3b75e9fc08b67e67cdc752aad1..7ad5a435e4b4462f54ec6f438e37d7398c07b04c 100644 (file)
@@ -161,6 +161,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        *width = mlt_properties_get_int( properties, "rescale_width" );
        *height = mlt_properties_get_int( properties, "rescale_height" );
 
+       mlt_service_lock( MLT_PRODUCER_SERVICE( &this->parent ) );
+
        // Refresh the image
        refresh_qimage( this, frame, *width, *height );
 
@@ -177,7 +179,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                uint8_t *image_copy = mlt_pool_alloc( image_size );
                memcpy( image_copy, this->current_image, image_size );
                // Now update properties so we free the copy after
-               mlt_properties_set_data( properties, "image", image_copy, image_size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, image_copy, image_size, mlt_pool_release );
                // We're going to pass the copy on
                *buffer = image_copy;
                *format = this->has_alpha ? mlt_image_rgb24a : mlt_image_rgb24;
@@ -192,6 +194,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        // Release references and locks
        pthread_mutex_unlock( &this->mutex );
        mlt_cache_item_close( this->image_cache );
+       mlt_service_unlock( MLT_PRODUCER_SERVICE( &this->parent ) );
 
        return error;
 }