#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
/** Do it :-).
*/
// Get the composite from the filter
mlt_transition composite = mlt_properties_get_data( properties, "composite", NULL );
+ // Get the resource to use
+ char *resource = mlt_properties_get( properties, "resource" );
+
+ // Get the old resource
+ char *old_resource = mlt_properties_get( properties, "old_resource" );
+
// Create a composite if we don't have one
if ( composite == NULL )
{
}
// Create a producer if don't have one
- if ( producer == NULL )
+ if ( producer == NULL || ( old_resource != NULL && strcmp( resource, old_resource ) ) )
{
- // Get the resource to use
- char *resource = mlt_properties_get( properties, "resource" );
-
// Get the factory producer service
char *factory = mlt_properties_get( properties, "factory" );
// Ensure that we loop
mlt_properties_set( mlt_producer_properties( producer ), "eof", "loop" );
+
+ // Set the old resource
+ mlt_properties_set( properties, "old_resource", resource );
}
}
return start;
}
+static inline void inline_memcpy( uint8_t *dest, uint8_t *src, int length )
+{
+ uint8_t *end = src + length;
+ while ( src < end )
+ {
+ *dest ++ = *src ++;
+ *dest ++ = *src ++;
+ }
+}
+
mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_position frame_position )
{
// Create a frame to return
while ( q < r )
{
- memcpy( q, p, w * 2 );
+ inline_memcpy( q, p, w * 2 );
q += w * 2;
p += width * 2;
}