X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Finigo%2Finigo.c;h=2dbda0e64850ac2f9021ea2a5ac49d4232d41cc1;hb=6fba6c383f2d7845f9eedf9f4e5e099319cfb43f;hp=38e0d13cebb5d8d0ac98c368e4c7ad3205a57166;hpb=cc8b6005abe30b5f0816b5aa6b87aa6867275228;p=melted diff --git a/src/inigo/inigo.c b/src/inigo/inigo.c index 38e0d13..2dbda0e 100644 --- a/src/inigo/inigo.c +++ b/src/inigo/inigo.c @@ -170,27 +170,30 @@ int main( int argc, char **argv ) // Parse the arguments for ( i = 1; i < argc; i ++ ) { - if ( !strcmp( argv[ i ], "-serialise" ) ) + if ( !strcmp( argv[ i ], "-consumer" ) ) { - i ++; + consumer = create_consumer( argv[ ++ i ], inigo ); + while ( argv[ i + 1 ] != NULL && strstr( argv[ i + 1 ], "=" ) ) + mlt_properties_parse( group, argv[ ++ i ] ); } - else if ( !strcmp( argv[ i ], "-consumer" ) ) + else if ( !strcmp( argv[ i ], "-serialise" ) ) { - consumer = create_consumer( argv[ ++ i ], inigo ); - while ( strstr( argv[ ++ i ], "=" ) ) - mlt_properties_parse( group, argv[ i ] ); - i --; + i ++; } else { if ( store != NULL ) fprintf( store, "%s\n", argv[ i ] ); + + i ++; + while ( argv[ i ] != NULL && argv[ i ][ 0 ] != '-' ) { - i ++; - if ( store != NULL && argv[ i ] != NULL && argv[ i ][ 0 ] != '-' ) + if ( store != NULL ) fprintf( store, "%s\n", argv[ i ] ); + i += 1; } + i --; } } @@ -211,8 +214,6 @@ int main( int argc, char **argv ) // Transport functionality transport( inigo ); - // Close the consumer - mlt_consumer_close( consumer ); } else if ( store != NULL ) { @@ -220,8 +221,6 @@ int main( int argc, char **argv ) fclose( store ); } - // Close the producer - mlt_producer_close( inigo ); } else { @@ -233,6 +232,14 @@ int main( int argc, char **argv ) " [ producer [ name=value ] * ]+\n" ); } + // Close the consumer + if ( consumer != NULL ) + mlt_consumer_close( consumer ); + + // Close the producer + if ( inigo != NULL ) + mlt_producer_close( inigo ); + // Close the factory mlt_factory_close( );