X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Fproducer_noise.c;h=257f0a2c7db20b05e200df739e58c06b762a73e1;hb=052a4094e84db1317d143849bb307a8f3c306bab;hp=fe86075bfca7d5b5685f55e7ff8549f9b8584e9c;hpb=9596911e0c624a73e354ecabfa9a565503d0ddf0;p=melted diff --git a/src/modules/core/producer_noise.c b/src/modules/core/producer_noise.c index fe86075..257f0a2 100644 --- a/src/modules/core/producer_noise.c +++ b/src/modules/core/producer_noise.c @@ -55,12 +55,9 @@ mlt_producer producer_noise_init( void *arg ) // Initialise the producer if ( this != NULL ) { - // Synthetic - aspect ratio of 1 - mlt_properties_set_double( mlt_producer_properties( this ), "aspect_ratio", 1 ); - // Callback registration this->get_frame = producer_get_frame; - this->close = producer_close; + this->close = ( mlt_destructor )producer_close; } return this; @@ -69,7 +66,7 @@ mlt_producer producer_noise_init( void *arg ) static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ) { // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( frame ); + mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); // Calculate the size of the image int size = *width * *height * 2; @@ -109,7 +106,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples ) { // Get the frame properties - mlt_properties properties = mlt_frame_properties( frame ); + mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); int size = 0; @@ -147,16 +144,10 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index if ( *frame != NULL ) { // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( *frame ); - - // Obtain properties of producer - mlt_properties producer_props = mlt_producer_properties( this ); - - // Determine if we're producing PAL or NTSC - int is_pal = mlt_properties_get_double( producer_props, "fps" ) == 25.0; + mlt_properties properties = MLT_FRAME_PROPERTIES( *frame ); - // Aspect ratio is 1? - mlt_properties_set_double( properties, "aspect_ratio", is_pal ? 128.0/117.0 : 72.0/79.0 ); + // Aspect ratio is whatever it needs to be + mlt_properties_set_double( properties, "aspect_ratio", 0 ); // Set producer-specific frame properties mlt_properties_set_int( properties, "progressive", 1 ); @@ -168,7 +159,7 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index mlt_frame_push_get_image( *frame, producer_get_image ); // Specify the audio - ( *frame )->get_audio = producer_get_audio; + mlt_frame_push_audio( *frame, producer_get_audio ); } // Calculate the next timecode