// 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 --;
}
}
// Transport functionality
transport( inigo );
- // Close the consumer
- mlt_consumer_close( consumer );
}
else if ( store != NULL )
{
fclose( store );
}
- // Close the producer
- mlt_producer_close( inigo );
}
else
{
" [ 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( );