]> git.sesse.net Git - mlt/blobdiff - src/modules/gtk2/producer_pixbuf.c
Add service locks for parallelism.
[mlt] / src / modules / gtk2 / producer_pixbuf.c
index c99d711e0bcc4708189a4496bd76c2ac6fd0d1ec..ab4aa66c0e9178ff1cec1a8522b7d3752fd989ae 100644 (file)
@@ -124,7 +124,7 @@ static void load_filenames( producer_pixbuf this, mlt_properties producer_proper
        {
                // Generate a temporary file for the svg
                char fullname[ 1024 ] = "/tmp/mlt.XXXXXX";
-               int fd = mkstemp( fullname );
+               int fd = g_mkstemp( fullname );
 
                if ( fd > -1 )
                {
@@ -461,6 +461,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_image( this, frame, *width, *height );
 
@@ -492,6 +494,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;
 }
@@ -529,7 +532,12 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 
                // Set producer-specific frame properties
                mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( producer_properties, "progressive" ) );
-               mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );
+               
+               double force_ratio = mlt_properties_get_double( producer_properties, "force_aspect_ratio" );
+               if ( force_ratio > 0.0 )
+                       mlt_properties_set_double( properties, "aspect_ratio", force_ratio );
+               else
+                       mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );
 
                // Push the get_image method
                mlt_frame_push_get_image( *frame, producer_get_image );