From cd57591f30d646a5a650d8e880ed24130eddc4b6 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Tue, 1 Apr 2014 22:21:30 -0700 Subject: [PATCH] Fix applying properties preset with multi consumer. In particular, when you use the syntax "0=service:arg" instead of "0=service 0.target=arg". --- src/modules/core/consumer_multi.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/modules/core/consumer_multi.c b/src/modules/core/consumer_multi.c index ffcc6086..8d0b66eb 100644 --- a/src/modules/core/consumer_multi.c +++ b/src/modules/core/consumer_multi.c @@ -259,12 +259,23 @@ static void foreach_consumer_init( mlt_consumer consumer ) if ( ( s = mlt_properties_get( properties, key ) ) ) { mlt_properties p = mlt_properties_new(); - int i, count; - if ( !p ) break; - mlt_properties_set( p, "mlt_service", mlt_properties_get( properties, key ) ); + + // Terminate mlt_service value at the argument delimiter if supplied. + // Needed here instead of just relying upon create_consumer() so that + // a properties preset is picked up correctly. + char *service = strdup( mlt_properties_get( properties, key ) ); + char *arg = strchr( service, ':' ); + if ( arg ) { + *arg ++ = '\0'; + mlt_properties_set( p, "target", arg ); + } + mlt_properties_set( p, "mlt_service", service ); + free( service ); + snprintf( key, sizeof(key), "%d.", index ); + int i, count; count = mlt_properties_count( properties ); for ( i = 0; i < count; i++ ) { -- 2.39.2