]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_frame.c
Add thread locks around accessing GlslManager resources.
[mlt] / src / framework / mlt_frame.c
index 5bd40c4c7c4bb24dd6d376125727347476cd4d6b..94a4d15a44c15500be56b1b31501eb0a7a12fb7c 100644 (file)
@@ -437,6 +437,10 @@ int mlt_image_format_size( mlt_image_format format, int width, int height, int *
                case mlt_image_yuv420p:
                        if ( bpp ) *bpp = 3 / 2;
                        return width * height * 3 / 2;
+               case mlt_image_glsl:
+               case mlt_image_glsl_texture:
+                       if ( bpp ) *bpp = 0;
+                       return 4;
                default:
                        if ( bpp ) *bpp = 0;
                        return 0;
@@ -1070,10 +1074,12 @@ mlt_frame mlt_frame_clone( mlt_frame self, int is_deep )
                data = mlt_properties_get_data( properties, "image", &size );
                if ( data )
                {
+                       int width = mlt_properties_get_int( properties, "width" );
+                       int height = mlt_properties_get_int( properties, "height" );
+
                        if ( ! size )
                                size = mlt_image_format_size( mlt_properties_get_int( properties, "format" ),
-                                       mlt_properties_get_int( properties, "width" ),
-                                       mlt_properties_get_int( properties, "height" ), NULL );
+                                       width, height, NULL );
                        copy = mlt_pool_alloc( size );
                        memcpy( copy, data, size );
                        mlt_properties_set_data( new_props, "image", copy, size, mlt_pool_release, NULL );
@@ -1082,8 +1088,7 @@ mlt_frame mlt_frame_clone( mlt_frame self, int is_deep )
                        if ( data )
                        {
                                if ( ! size )
-                                       size = mlt_properties_get_int( properties, "width" ) *
-                                               mlt_properties_get_int( properties, "height" );
+                                       size = width * height;
                                copy = mlt_pool_alloc( size );
                                memcpy( copy, data, size );
                                mlt_properties_set_data( new_props, "alpha", copy, size, mlt_pool_release, NULL );