+
+ // Get frame from the real producer
+ mlt_frame first_frame = mlt_properties_get_data( properties, "first_frame", NULL );
+
+ if ( first_frame == NULL )
+ {
+ // Get the frame to cache from the real producer
+ mlt_producer real_producer = mlt_properties_get_data( properties, "producer", NULL );
+
+ // Seek the producer to the correct place
+ mlt_producer_seek( real_producer, mlt_producer_position( producer ) );
+
+ // Get the frame
+ mlt_service_get_frame( MLT_PRODUCER_SERVICE( real_producer ), &first_frame, index );
+ // Cache the frame
+ mlt_properties_set_data( properties, "first_frame", first_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
+ }
+
+ mlt_properties_inherit( frame_properties, MLT_FRAME_PROPERTIES(first_frame) );