X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fkdenlive%2Fproducer_framebuffer.c;h=97edd6dca922e63e8599f32139c0f83ffc937ea3;hb=d6b4ee42b35e0ec5c21a7d7db7069e683195a5f8;hp=2c8684fed2162e037a8902d7cf74cf0265fa96a2;hpb=67c967f4fda7f62432ebdf79e364def6321e7c37;p=melted diff --git a/src/modules/kdenlive/producer_framebuffer.c b/src/modules/kdenlive/producer_framebuffer.c index 2c8684f..97edd6d 100644 --- a/src/modules/kdenlive/producer_framebuffer.c +++ b/src/modules/kdenlive/producer_framebuffer.c @@ -194,7 +194,7 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index mlt_producer producer_framebuffer_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - + if ( !arg ) return NULL; mlt_producer this = NULL; this = calloc( 1, sizeof( struct mlt_producer_s ) ); mlt_producer_init( this, NULL ); @@ -205,8 +205,8 @@ mlt_producer producer_framebuffer_init( mlt_profile profile, mlt_service_type ty // Check if a speed was specified. /** - * Speed must be appended to the filename with ':'. To play your video at 50%: - inigo framebuffer:my_video.mpg:0.5 + * Speed must be appended to the filename with '?'. To play your video at 50%: + inigo framebuffer:my_video.mpg?0.5 * Stroboscope effect can be obtained by adding a stobe=x parameter, where x is the number of frames that will be ignored. @@ -218,25 +218,24 @@ mlt_producer producer_framebuffer_init( mlt_profile profile, mlt_service_type ty **/ - double speed; - - int count; + double speed = 0.0; char *props = strdup( arg ); - char *ptr = props; - count = strcspn( ptr, "?" ); - ptr[count] = '\0'; + char *ptr = strrchr( props, '?' ); + + if ( ptr ) + { + speed = atof( ptr + 1 ); + if ( speed != 0.0 ) + // If speed was valid, then strip it and the delimiter. + // Otherwise, an invalid speed probably means this '?' was not a delimiter. + *ptr = '\0'; + } + real_producer = mlt_factory_producer( profile, "fezzik", props ); - - ptr += count + 1; - ptr += strspn( ptr, "?" ); - count = strcspn( ptr, "?" ); - ptr[count] = '\0'; - speed = atof(ptr); free( props ); if (speed == 0.0) speed = 1.0; - if ( this != NULL && real_producer != NULL) { // Get the properties of this producer