int ret = mlt_service_get_frame( this->producer, frame, index );
if ( ret == 0 )
{
- if ( !mlt_frame_is_test_card( *frame ) )
- {
- mlt_position position = mlt_frame_get_position( *frame );
- if ( position >= in && ( out == 0 || position < out ) )
- *frame = filter_process( this, *frame );
- }
+ mlt_position position = mlt_frame_get_position( *frame );
+ if ( position >= in && ( out == 0 || position < out ) )
+ *frame = filter_process( this, *frame );
return 0;
}
else
}
else
{
- if ( test_card.vfmt != *format )
+ if ( test_card.vfmt != *format || test_card.width != *width || test_card.height != *height || test_card.image == NULL )
{
uint8_t *p;
uint8_t *q;
-
+
test_card.vfmt = *format;
test_card.width = *width == 0 ? 720 : *width;
test_card.height = *height == 0 ? 576 : *height;
*width = test_card.width;
*height = test_card.height;
*buffer = test_card.image;
+
+ mlt_properties_set_int( properties, "width", *width );
+ mlt_properties_set_int( properties, "height", *height );
+
+ if ( writable )
+ {
+ uint8_t *copy = malloc( *width * *height * 2 );
+ memcpy( copy, *buffer, *width * *height * 2 );
+ mlt_properties_set_data( properties, "image", copy, *width * *height * 2, free, NULL );
+ *buffer = copy;
+ }
+ else
+ {
+ mlt_properties_set_data( properties, "image", *buffer, *width * *height * 2, NULL, NULL );
+ }
}
return 0;