mlt_properties_set( properties, "resource", "pango" );
mlt_properties_set( properties, "markup", "" );
}
+ else if ( filename[ 0 ] == '+' )
+ {
+ char *markup = strdup( filename + 1 );
+ ( *strrchr( markup, '.' ) ) = '\0';
+ while ( strchr( markup, '~' ) )
+ ( *strchr( markup, '~' ) ) = '\n';
+ mlt_properties_set( properties, "resource", ( char * )filename );
+ mlt_properties_set( properties, "markup", markup );
+ free( markup );
+ }
else
{
FILE *f = fopen( filename, "r" );
}
}
fclose( f );
+
+ if ( markup[ strlen( markup ) - 1 ] == '\n' )
+ markup[ strlen( markup ) - 1 ] = '\0';
+
mlt_properties_set( properties, "resource", ( char * ) filename );
mlt_properties_set( properties, "markup", ( char * ) ( markup == NULL ? "" : markup ) );
- if ( markup )
- free( markup );
+ free( markup );
}
else
{
// Register this pixbuf for destruction and reuse
mlt_properties_set_data( producer_props, "pixbuf", pixbuf, 0, ( mlt_destructor )g_object_unref, NULL );
+ mlt_properties_set_int( producer_props, "real_width", gdk_pixbuf_get_width( pixbuf ) );
+ mlt_properties_set_int( producer_props, "real_height", gdk_pixbuf_get_height( pixbuf ) );
+
// Store the width/height of the pixbuf temporarily
this->width = gdk_pixbuf_get_width( pixbuf );
this->height = gdk_pixbuf_get_height( pixbuf );
}
}
- else if ( width != this->width || height != this->height )
+ else if ( this->image == NULL || width != this->width || height != this->height )
{
pixbuf = mlt_properties_get_data( producer_props, "pixbuf", NULL );
}
// If we have a pixbuf and a valid width
if ( pixbuf && width > 0 )
{
- int delete = 0;
-
- // Scale to width/height requested
- if ( width != this->width && height != this->height )
- {
- // Note - the original pixbuf is already safe and ready for destruction
- pixbuf = gdk_pixbuf_scale_simple( pixbuf, width, height, GDK_INTERP_HYPER );
- delete = 1;
- }
+ // Note - the original pixbuf is already safe and ready for destruction
+ pixbuf = gdk_pixbuf_scale_simple( pixbuf, width, height, GDK_INTERP_HYPER );
// Store width and height
this->width = gdk_pixbuf_get_width( pixbuf );
}
// Finished with pixbuf now
- if ( delete )
- g_object_unref( pixbuf );
+ g_object_unref( pixbuf );
// if single picture, reference the image and alpha in the producer
free( this->image );
// Set width/height
mlt_properties_set_int( properties, "width", this->width );
mlt_properties_set_int( properties, "height", this->height );
+ mlt_properties_set_int( properties, "real_width", mlt_properties_get_int( producer_props, "real_width" ) );
+ mlt_properties_set_int( properties, "real_height", mlt_properties_get_int( producer_props, "real_height" ) );
// pass the image and alpha data without destructor
mlt_properties_set_data( properties, "image", this->image, this->width * this->height * 2, NULL, NULL );