X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Fproducer_colour.c;h=0c40f99b0ff17c68f2153fd9de015343555c564e;hb=22b237f78474fdca383d29df1e58ae7021e9df58;hp=29bde448814828e990c25fe378a52cc4b41a4854;hpb=52c1bb26fcbb895824cd9237c228ea4834ce1433;p=melted diff --git a/src/modules/core/producer_colour.c b/src/modules/core/producer_colour.c index 29bde44..0c40f99 100644 --- a/src/modules/core/producer_colour.c +++ b/src/modules/core/producer_colour.c @@ -41,7 +41,7 @@ mlt_producer producer_colour_init( char *colour ) if ( producer != NULL && mlt_producer_init( producer, NULL ) == 0 ) { // Get the properties interface - mlt_properties properties = mlt_producer_properties( producer ); + mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer ); // Callback registration producer->get_frame = producer_get_frame; @@ -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; @@ -106,13 +109,13 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form int size = 0; // Obtain properties of frame - mlt_properties properties = mlt_frame_properties( frame ); + mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); // Obtain the producer for this frame mlt_producer producer = mlt_properties_get_data( properties, "producer_colour", NULL ); // Obtain properties of producer - mlt_properties producer_props = mlt_producer_properties( producer ); + mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer ); // Get the current image and dimensions cached in the producer uint8_t *image = mlt_properties_get_data( producer_props, "image", &size ); @@ -180,10 +183,10 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i if ( *frame != NULL ) { // Obtain properties of frame and producer - mlt_properties properties = mlt_frame_properties( *frame ); + mlt_properties properties = MLT_FRAME_PROPERTIES( *frame ); // Obtain properties of producer - mlt_properties producer_props = mlt_producer_properties( 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; @@ -196,7 +199,7 @@ 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 ); + mlt_properties_set_double( properties, "aspect_ratio", is_pal ? 59.0/54.0 : 10.0/11.0 ); // colour is an alias for resource if ( mlt_properties_get( producer_props, "colour" ) != NULL )