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.
if ( test_frame != NULL )
{
mlt_properties test_properties = mlt_frame_properties( test_frame );
- mlt_properties_set( test_properties, "rescale.interp", "nearest" );
mlt_properties_set_double( test_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
+ 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 );
}
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 samples = 0;
- if ( fps > 29 && fps <= 30 )
+ if ( ( int )( fps * 100 ) == 2997 )
{
samples = frequency / 30;