X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Fproducer_colour.c;h=b4e8da830cf516df2df97085ecb573c1f4024d13;hb=90da79f8e465d43102645de7323d15c12801515f;hp=bee525adf81eb9a386c0f8e63abc91fb2792d0ee;hpb=3544a004b42ec88fa0d1ef95733b875d7071ffcf;p=melted diff --git a/src/modules/core/producer_colour.c b/src/modules/core/producer_colour.c index bee525a..b4e8da8 100644 --- a/src/modules/core/producer_colour.c +++ b/src/modules/core/producer_colour.c @@ -45,7 +45,7 @@ mlt_producer producer_colour_init( char *colour ) // Callback registration producer->get_frame = producer_get_frame; - producer->close = producer_close; + producer->close = ( mlt_destructor )producer_close; // Set the default properties mlt_properties_set( properties, "resource", colour == NULL ? "0x000000ff" : colour ); @@ -60,6 +60,9 @@ rgba_color parse_color( char *color ) { rgba_color result = { 0xff, 0xff, 0xff, 0xff }; + if ( strchr( color, '/' ) ) + color = strrchr( color, '/' ) + 1; + if ( !strncmp( color, "0x", 2 ) ) { unsigned int temp = 0; @@ -185,6 +188,9 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i // Obtain properties of producer mlt_properties producer_props = mlt_producer_properties( producer ); + // Determine if we're producing PAL or NTSC + int is_pal = mlt_properties_get_double( producer_props, "fps" ) == 25.0; + // Set the producer on the frame properties mlt_properties_set_data( properties, "producer_colour", producer, 0, NULL, NULL ); @@ -193,10 +199,9 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i // Set producer-specific frame properties mlt_properties_set_int( properties, "progressive", 1 ); - mlt_properties_set_int( properties, "aspect_ratio", 1 ); + mlt_properties_set_double( properties, "aspect_ratio", is_pal ? 59.0/54.0 : 10.0/11.0 ); // colour is an alias for resource - // CY: Do we really need this? if ( mlt_properties_get( producer_props, "colour" ) != NULL ) mlt_properties_set( producer_props, "resource", mlt_properties_get( producer_props, "colour" ) );