]> git.sesse.net Git - mlt/commitdiff
Fix applying properties preset with multi consumer.
authorDan Dennedy <dan@dennedy.org>
Wed, 2 Apr 2014 05:21:30 +0000 (22:21 -0700)
committerDan Dennedy <dan@dennedy.org>
Wed, 2 Apr 2014 05:21:30 +0000 (22:21 -0700)
In particular, when you use the syntax "0=service:arg" instead of
"0=service 0.target=arg".

src/modules/core/consumer_multi.c

index ffcc608619a7bc4b50967861c72efe769bb2cd5e..8d0b66eb71a17514e9d21bf60747aa0dba5f3afc 100644 (file)
@@ -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++ )
                                {