X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_frame.c;h=6424a5477eaa56eecd4f1c9eb998f88fd4580fce;hb=a3b7c7245a4ec492e5eecc76548f4a97bb648709;hp=52de88d9ea40757ab28e936f3dcfb1ccfdaed079;hpb=40b169c095486ba1b868486eb98a47c41f36ce8c;p=melted diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 52de88d..6424a54 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" #include "mlt_frame.h" #include "mlt_producer.h" #include "mlt_factory.h" @@ -32,13 +31,15 @@ /** Constructor for a frame. */ -mlt_frame mlt_frame_init( ) +mlt_frame mlt_frame_init( mlt_service service ) { // Allocate a frame mlt_frame this = calloc( sizeof( struct mlt_frame_s ), 1 ); if ( this != NULL ) { + mlt_profile profile = mlt_service_profile( service ); + // Initialise the properties mlt_properties properties = &this->parent; mlt_properties_init( properties, this ); @@ -46,10 +47,10 @@ mlt_frame mlt_frame_init( ) // Set default properties on the frame mlt_properties_set_position( properties, "_position", 0.0 ); mlt_properties_set_data( properties, "image", NULL, 0, NULL, NULL ); - mlt_properties_set_int( properties, "width", mlt_profile_get()->width ); - mlt_properties_set_int( properties, "height", mlt_profile_get()->height ); - mlt_properties_set_int( properties, "normalised_width", mlt_profile_get()->width ); - mlt_properties_set_int( properties, "normalised_height", mlt_profile_get()->height ); + mlt_properties_set_int( properties, "width", profile? profile->width : 720 ); + mlt_properties_set_int( properties, "height", profile? profile->height : 576 ); + mlt_properties_set_int( properties, "normalised_width", profile? profile->width : 720 ); + mlt_properties_set_int( properties, "normalised_height", profile? profile->height : 576 ); mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( NULL ) ); mlt_properties_set_data( properties, "audio", NULL, 0, NULL, NULL ); mlt_properties_set_data( properties, "alpha", NULL, 0, NULL, NULL ); @@ -445,7 +446,7 @@ unsigned char *mlt_frame_get_waveform( mlt_frame this, int w, int h ) mlt_audio_format format = mlt_audio_pcm; int frequency = 32000; // lower frequency available? int channels = 2; - double fps = mlt_properties_get_double( properties, "fps" ); + double fps = mlt_profile_fps( NULL ); int samples = mlt_sample_calculator( fps, frequency, mlt_frame_get_position( this ) ); // Get the pcm data