mlt_frame_set_audio( frame, new_buffer, *format, size, mlt_pool_release );
memcpy( new_buffer, *buffer, size );
*buffer = new_buffer;
+ cx->audio_position = mlt_frame_get_position( nested_frame );
}
else
{
// otherwise return no samples
*samples = 0;
+ *buffer = NULL;
}
- cx->audio_position = mlt_frame_get_position( nested_frame );
return result;
}
mlt_properties_set_data( properties, "context", cx, 0, mlt_pool_release, NULL );
cx->this = this;
char *profile_name = mlt_properties_get( properties, "profile" );
+ if ( !profile_name )
+ profile_name = mlt_properties_get( properties, "mlt_profile" );
mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( this ) );
if ( profile_name )
// Since we control the seeking, prevent it from seeking on its own
mlt_producer_set_speed( cx->producer, 0 );
+ cx->audio_position = -1;
// We will encapsulate a consumer
cx->consumer = mlt_consumer_new( cx->profile );
// Generate a frame
*frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
- if ( frame )
+ if ( *frame )
{
// Seek the producer to the correct place
// Calculate our positions
if ( mlt_producer_get_speed( this ) != 0 )
actual_position *= mlt_producer_get_speed( this );
mlt_position need_first = floor( actual_position );
- mlt_producer_seek( cx->producer, need_first * mlt_profile_fps( cx->profile )
- / mlt_producer_get_fps( this ) );
+ mlt_producer_seek( cx->producer,
+ lrint( need_first * mlt_profile_fps( cx->profile ) / mlt_producer_get_fps( this ) ) );
// Get the nested frame
mlt_frame nested_frame = mlt_consumer_rt_frame( cx->consumer );
mlt_properties_set_double( frame_props, "aspect_ratio", mlt_profile_sar( cx->profile ) );
mlt_properties_set_int( frame_props, "width", cx->profile->width );
mlt_properties_set_int( frame_props, "height", cx->profile->height );
- mlt_properties_set_int( frame_props, "real_width", cx->profile->width );
- mlt_properties_set_int( frame_props, "real_height", cx->profile->height );
+ mlt_properties_set_int( frame_props, "meta.media.width", cx->profile->width );
+ mlt_properties_set_int( frame_props, "meta.media.height", cx->profile->height );
mlt_properties_set_int( frame_props, "progressive", cx->profile->progressive );
}
// Encapsulate the real producer
mlt_profile temp_profile = mlt_profile_clone( profile );
+ temp_profile->is_explicit = 0;
mlt_producer real_producer = mlt_factory_producer( temp_profile, NULL, arg );
if ( this && real_producer )