+ mlt_service_apply_filters( self, *frame, 1 );
+ mlt_deque_push_back( MLT_FRAME_SERVICE_STACK( *frame ), self );
+
+ if ( mlt_service_identify( self ) == producer_type &&
+ mlt_properties_get_int( MLT_SERVICE_PROPERTIES( self ), "_need_previous_next" ) )
+ {
+ // Save the new position from self->get_frame
+ mlt_position new_position = mlt_producer_position( MLT_PRODUCER( self ) );
+
+ // Get the preceding frame, unfiltered
+ mlt_frame previous_frame;
+ mlt_producer_seek( MLT_PRODUCER(self), position - 1 );
+ result = self->get_frame( self, &previous_frame, index );
+ if ( !result )
+ mlt_properties_set_data( properties, "previous frame",
+ previous_frame, 0, ( mlt_destructor ) mlt_frame_close, NULL );
+
+ // Get the following frame, unfiltered
+ mlt_frame next_frame;
+ mlt_producer_seek( MLT_PRODUCER(self), position + 1 );
+ result = self->get_frame( self, &next_frame, index );
+ if ( !result )
+ {
+ mlt_properties_set_data( properties, "next frame",
+ next_frame, 0, ( mlt_destructor ) mlt_frame_close, NULL );
+ }
+
+ // Restore the new position
+ mlt_producer_seek( MLT_PRODUCER(self), new_position );
+ }