From: Dan Dennedy Date: Mon, 28 Nov 2011 22:06:15 +0000 (-0800) Subject: support consumers that use constructor arg instead of target property X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=021320bfcc3e3c11300196b4482a83827d4cefb3;p=mlt support consumers that use constructor arg instead of target property --- diff --git a/src/modules/core/consumer_multi.c b/src/modules/core/consumer_multi.c index 90223bbd..948bf4a9 100644 --- a/src/modules/core/consumer_multi.c +++ b/src/modules/core/consumer_multi.c @@ -62,13 +62,15 @@ mlt_consumer consumer_multi_init( mlt_profile profile, mlt_service_type type, co return consumer; } -static mlt_consumer create_consumer( mlt_profile profile, char *id ) +static mlt_consumer create_consumer( mlt_profile profile, char *id, char *arg ) { char *myid = id ? strdup( id ) : NULL; - char *arg = myid ? strchr( myid, ':' ) : NULL; - if ( arg != NULL ) - *arg ++ = '\0'; - mlt_consumer consumer = mlt_factory_consumer( profile, myid, arg ); + char *myarg = ( myid && !arg ) ? strchr( myid, ':' ) : NULL; + if ( myarg ) + *myarg ++ = '\0'; + else + myarg = arg; + mlt_consumer consumer = mlt_factory_consumer( profile, myid, myarg ); if ( myid ) free( myid ); return consumer; @@ -142,7 +144,8 @@ static mlt_consumer generate_consumer( mlt_consumer consumer, mlt_properties pro profile = mlt_profile_init( mlt_properties_get( props, "mlt_profile" ) ); if ( !profile ) profile = mlt_profile_clone( mlt_service_profile( MLT_CONSUMER_SERVICE(consumer) ) ); - mlt_consumer nested = create_consumer( profile, mlt_properties_get( props, "mlt_service" ) ); + mlt_consumer nested = create_consumer( profile, mlt_properties_get( props, "mlt_service" ), + mlt_properties_get( props, "target" ) ); if ( nested ) {