if ( producer != NULL )
{
// Test card should loop I guess...
- mlt_properties_set( mlt_producer_properties( producer ), "eof", "loop" );
+ mlt_properties_set( mlt_producer_properties( producer ), "eof", "pause" );
+ mlt_producer_set_speed( producer, 0 );
+ mlt_producer_set_in_and_out( producer, 0, 0 );
// Set the test card on the consumer
mlt_properties_set_data( properties, "test_card_producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL );
mlt_position mlt_frame_get_position( mlt_frame this )
{
- return mlt_properties_get_position( mlt_frame_properties( this ), "_position" );
+ int pos = mlt_properties_get_position( mlt_frame_properties( this ), "_position" );
+ return pos < 0 ? 0 : pos;
}
/** Set the position of this frame.
return 0;
}
+/** Return the ref count of this object.
+*/
+
+int mlt_properties_ref_count( mlt_properties this )
+{
+ if ( this != NULL )
+ {
+ property_list *list = this->local;
+ return list->ref_count;
+ }
+ return 0;
+}
+
/** Allow the specification of a mirror.
*/
extern mlt_properties mlt_properties_load( char *file );
extern int mlt_properties_inc_ref( mlt_properties self );
extern int mlt_properties_dec_ref( mlt_properties self );
+extern int mlt_properties_ref_count( mlt_properties self );
extern void mlt_properties_mirror( mlt_properties self, mlt_properties that );
extern int mlt_properties_inherit( mlt_properties self, mlt_properties that );
extern int mlt_properties_pass( mlt_properties self, mlt_properties that, char *prefix );
mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
}
- if ( 1 )
+ if ( image != NULL )
{
char *rescale = mlt_properties_get( properties, "rescale" );
if ( rescale != NULL && strcmp( rescale, "none" ) )
if ( unlock != NULL ) unlock( );
- return 0;
+ return 1;
}
/** Threaded wrapper for pipe.
// internal intialization
mlt_frame frame = NULL;
- struct timespec tm = { 0, 400000 };
+ struct timespec tm = { 0, 1000000 };
if ( mlt_properties_get_int( mlt_consumer_properties( consumer ), "sdl_started" ) == 0 )
{
// Ensure that we have a frame
if ( frame != NULL )
{
- consumer_play_video( this, frame );
+ if ( consumer_play_video( this, frame ) == 0 )
+ nanosleep( &tm, NULL );
mlt_frame_close( frame );
- nanosleep( &tm, NULL );
}
}
// Get all the properties now
char *server = mlt_properties_get( properties, "server" );
int port = mlt_properties_get_int( properties, "port" );
- char *command = mlt_properties_get( properties, "command" );
+ char *cmd = mlt_properties_get( properties, "command" );
int unit = mlt_properties_get_int( properties, "unit" );
char *title = mlt_properties_get( properties, "title" );
+ char command[ 2048 ];
// If this is a reuse, then a valerie object will exist
valerie connection = mlt_properties_get_data( properties, "connection", NULL );
// Special case - we can get a doc too...
char *doc = mlt_properties_get( properties, "westley" );
+ // Set the title if provided
+ if ( service != NULL )
+ {
+ if ( title != NULL )
+ mlt_properties_set( mlt_service_properties( service ), "title", title );
+ else if ( mlt_properties_get( mlt_service_properties( service ), "title" ) == NULL )
+ mlt_properties_set( mlt_service_properties( service ), "title", "Anonymous Submission" );
+ title = mlt_properties_get( mlt_service_properties( service ), "title" );
+ }
+
+ strcpy( command, cmd == NULL ? "" : cmd );
+ if ( strstr( command, "title=" ) == NULL && title != NULL )
+ {
+ strcat( command, " title=\"" );
+ strcat( command, title );
+ strcat( command, "\"" );
+ }
+
if ( service != NULL || doc != NULL )
{
// Initiate the connection if required
{
int error;
- // Set the title if provided
- if ( title != NULL )
- mlt_properties_set( mlt_service_properties( service ), "title", title );
- else if ( mlt_properties_get( mlt_service_properties( service ), "title" ) == NULL )
- mlt_properties_set( mlt_service_properties( service ), "title", "Anonymous Submission" );
-
// Push the service
error = valerie_unit_push( connection, unit, command, service );