mlt_properties mlt_frame_properties( mlt_frame this )
{
- return &this->parent;
+ return this != NULL ? &this->parent : NULL;
}
/** Check if we have a way to derive something other than a test card.
int mlt_frame_is_test_card( mlt_frame this )
{
- return mlt_properties_get_int( mlt_frame_properties( this ), "test_image" );
+ return mlt_deque_count( this->stack_image ) == 0 || mlt_properties_get_int( mlt_frame_properties( this ), "test_image" );
}
/** Check if we have a way to derive something than test audio.
{
mlt_properties test_properties = mlt_frame_properties( test_frame );
mlt_properties_set_double( test_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
- mlt_properties_set( test_properties, "rescale.interp", "nearest" );
+ mlt_properties_set( test_properties, "rescale.interp", mlt_properties_get( properties, "rescale.interp" ) );
mlt_frame_get_image( test_frame, buffer, format, width, height, writable );
mlt_properties_set_data( properties, "test_card_frame", test_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
mlt_properties_set_data( properties, "image", *buffer, *width * *height * 2, NULL, NULL );
mlt_properties_set_int( properties, "width", *width );
mlt_properties_set_int( properties, "height", *height );
+ mlt_properties_set( properties, "rescale.interp", "none" );
+ mlt_properties_set( properties, "scale", "off" );
}
else
{
}
else
{
- uint8_t *p;
- uint8_t *q;
+ register uint8_t *p;
+ register uint8_t *q;
int size = 0;
*width = *width == 0 ? 720 : *width;
if ( this->get_audio != NULL )
{
- return this->get_audio( this, buffer, format, frequency, channels, samples );
+ this->get_audio( this, buffer, format, frequency, channels, samples );
+ }
+ else if ( mlt_properties_get_data( properties, "audio", NULL ) )
+ {
+ *buffer = mlt_properties_get_data( properties, "audio", NULL );
+ *frequency = mlt_properties_get_int( properties, "audio_frequency" );
+ *channels = mlt_properties_get_int( properties, "audio_channels" );
+ *samples = mlt_properties_get_int( properties, "audio_samples" );
}
else
{
mlt_properties_set_data( properties, "audio", *buffer, size, ( mlt_destructor )mlt_pool_release, NULL );
mlt_properties_set_int( properties, "test_audio", 1 );
}
+
+ mlt_properties_set_int( properties, "audio_frequency", *frequency );
+ mlt_properties_set_int( properties, "audio_channels", *channels );
+ mlt_properties_set_int( properties, "audio_samples", *samples );
+
return 0;
}
int active_width = 2 * iwidth;
int inactive_width = out_x_range - in_x_range;
+ uint8_t *p = NULL;
+ uint8_t *end = NULL;
// Loop for the entirety of our output height.
while ( iheight -- )
}
// We're in the input range for this row.
- memcpy( out_ptr, in_middle + in_line, active_width );
- out_ptr += active_width;
+ p = in_middle + in_line;
+ end = out_ptr + active_width;
+ while ( out_ptr != end )
+ {
+ *out_ptr ++ = *p ++;
+ *out_ptr ++ = *p ++;
+ }
// Fill the outer part with black
elements = inactive_width;
{
int samples = 0;
- if ( fps > 29 && fps <= 30 )
+ if ( ( int )( fps * 100 ) == 2997 )
{
samples = frequency / 30;