+/** Remove everything up to the current clip from the unit.
+*/
+
+static void wipe_unit( miracle_unit unit )
+{
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_clip_info info;
+ int current = mlt_playlist_current_clip( playlist );
+ mlt_playlist_get_clip_info( playlist, &info, current );
+
+ if ( info.producer != NULL && info.start > 0 )
+ {
+ mlt_service_lock( MLT_PLAYLIST_SERVICE( playlist ) );
+ mlt_playlist_remove_region( playlist, 0, info.start - 1 );
+ mlt_service_unlock( MLT_PLAYLIST_SERVICE( playlist ) );
+ }
+
+ update_generation( unit );
+}
+