X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Fproducer_colour.c;h=2cc677905a2fe4b4772a7f23eda68c1aab1c3a23;hb=e25076bb729fbb4a35b095bc58f3facbcbe82ef5;hp=43d019dc50c922ab47934629b3fc2de96059d95d;hpb=5b59ce704d4f317e845afa30c5ade12c0fd22d43;p=melted diff --git a/src/modules/core/producer_colour.c b/src/modules/core/producer_colour.c index 43d019d..2cc6779 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,9 +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_double( properties, "aspect_ratio", is_pal ? 128.0/117.0 : 72.0/79.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" ) ); @@ -215,4 +221,3 @@ static void producer_close( mlt_producer producer ) mlt_producer_close( producer ); free( producer ); } -