case '9':
mlt_producer_set_speed( producer, 10 );
break;
+ case 'd':
+ if ( multitrack != NULL )
+ {
+ int i = 0;
+ mlt_position last = -1;
+ for ( i = 0; 1; i ++ )
+ {
+ mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_start, i );
+ if ( time == last )
+ break;
+ last = time;
+ fprintf( stderr, "%d: %lld\n", i, time );
+ }
+ }
+ break;
+
case 'g':
if ( multitrack != NULL )
{
- mlt_timecode time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 0 );
+ mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 0 );
mlt_producer_seek( producer, time );
}
break;
case 'h':
if ( multitrack != NULL )
{
- mlt_producer producer = mlt_multitrack_producer( multitrack );
- int64_t position = mlt_producer_frame_position( producer, mlt_producer_position( producer ) );
+ mlt_position position = mlt_producer_position( producer );
mlt_producer_set_speed( producer, 0 );
- mlt_producer_seek_frame( producer, position - 1 >= 0 ? position - 1 : 0 );
+ mlt_producer_seek( producer, position - 1 >= 0 ? position - 1 : 0 );
}
break;
case 'j':
if ( multitrack != NULL )
{
- mlt_timecode time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 1 );
+ mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 1 );
mlt_producer_seek( producer, time );
}
break;
case 'k':
if ( multitrack != NULL )
{
- mlt_timecode time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, -1 );
+ mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, -1 );
mlt_producer_seek( producer, time );
}
break;
case 'l':
if ( multitrack != NULL )
{
- mlt_producer producer = mlt_multitrack_producer( multitrack );
- int64_t position = mlt_producer_frame_position( producer, mlt_producer_position( producer ) );
+ mlt_position position = mlt_producer_position( producer );
mlt_producer_set_speed( producer, 0 );
- mlt_producer_seek_frame( producer, position + 1 );
+ mlt_producer_seek( producer, position + 1 );
}
break;
}
// 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( );