mlt_properties_set_int( properties, "aspect_ratio", 1 );
mlt_properties_set_int( properties, "progressive", 1 );
mlt_properties_set_int( properties, "seekable", 1 );
- mlt_properties_set_int( properties, "loop", 1 );
+ mlt_properties_set_int( properties, "loop", 1 );
// Validate the resource
if ( filename )
position += mlt_producer_get_in( producer );
// Image index
- int loop = mlt_properties_get_int( producer_props, "loop" );
- int current_idx;
- if (loop) {
+ int loop = mlt_properties_get_int( producer_props, "loop" );
+ int current_idx;
+ if (loop) {
current_idx = ( int )floor( ( double )position / ttl ) % self->count;
- } else {
+ } else {
current_idx = MIN(( double )position / ttl, self->count - 1);
- }
+ }
// Key for the cache
char image_key[ 10 ];
if ( self->pixbuf && ( !self->image || ( format != mlt_image_none && format != self->format ) ) )
{
char *interps = mlt_properties_get( properties, "rescale.interp" );
+ if ( interps ) interps = strdup( interps );
int interp = GDK_INTERP_BILINEAR;
if ( !interps ) {
interp = GDK_INTERP_TILES;
else if ( strcmp( interps, "hyper" ) == 0 || strcmp( interps, "bicubic" ) == 0 )
interp = GDK_INTERP_HYPER;
+ if ( interps ) free( interps );
// Note - the original pixbuf is already safe and ready for destruction
pthread_mutex_lock( &g_mutex );
mlt_producer producer = &self->parent;
// Use the width and height suggested by the rescale filter because we can do our own scaling.
- *width = mlt_properties_get_int( properties, "rescale_width" );
- *height = mlt_properties_get_int( properties, "rescale_height" );
+ if ( mlt_properties_get_int( properties, "rescale_width" ) > 0 )
+ *width = mlt_properties_get_int( properties, "rescale_width" );
+ if ( mlt_properties_get_int( properties, "rescale_height" ) > 0 )
+ *height = mlt_properties_get_int( properties, "rescale_height" );
// Restore pixbuf and image
mlt_service_lock( MLT_PRODUCER_SERVICE( producer ) );