#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 );
}
}