X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fvalerie%2Fconsumer_valerie.c;h=71a274c8e946b833cd9be155d4c1ed1fdeda1359;hb=4580365ba2f57f530aa4bdeb57788822fab09e2f;hp=781238d5dd2444da1e3195afa4693b50982e99c6;hpb=de477d594bdd9c5d9ee2d3441cd0ccf49ab52feb;p=melted diff --git a/src/modules/valerie/consumer_valerie.c b/src/modules/valerie/consumer_valerie.c index 781238d..71a274c 100644 --- a/src/modules/valerie/consumer_valerie.c +++ b/src/modules/valerie/consumer_valerie.c @@ -93,7 +93,10 @@ static int consumer_start( mlt_consumer this ) // If this is a reuse, then a valerie object will exist valerie connection = mlt_properties_get_data( properties, "connection", NULL ); - if ( service != NULL ) + // Special case - we can get a doc too... + char *doc = mlt_properties_get( properties, "westley" ); + + if ( service != NULL || doc != NULL ) { // Initiate the connection if required if ( connection == NULL ) @@ -117,20 +120,32 @@ static int consumer_start( mlt_consumer this ) // If we have connection, push the service over if ( connection != NULL ) { - int error; + if ( doc == NULL ) + { + 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" ); + // 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 ); + // Push the service + error = valerie_unit_push( connection, unit, command, service ); - // Report error - if ( error != valerie_ok ) - fprintf( stderr, "Push failed on %s:%d %s u%d (%d)\n", server, port, command, unit, error ); + // Report error + if ( error != valerie_ok ) + fprintf( stderr, "Push failed on %s:%d %s u%d (%d)\n", server, port, command, unit, error ); + } + else + { + // Push the service + int error = valerie_unit_receive( connection, unit, command, doc ); + + // Report error + if ( error != valerie_ok ) + fprintf( stderr, "Send failed on %s:%d %s u%d (%d)\n", server, port, command, unit, error ); + } } }