X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fvalerie%2Fconsumer_valerie.c;h=781238d5dd2444da1e3195afa4693b50982e99c6;hb=de477d594bdd9c5d9ee2d3441cd0ccf49ab52feb;hp=e47358484cb2c94c46b955d4717f3600386de9ae;hpb=d3e965e4d67fcba9565f415d6915690306e31d6a;p=melted diff --git a/src/modules/valerie/consumer_valerie.c b/src/modules/valerie/consumer_valerie.c index e473584..781238d 100644 --- a/src/modules/valerie/consumer_valerie.c +++ b/src/modules/valerie/consumer_valerie.c @@ -42,15 +42,28 @@ mlt_consumer consumer_valerie_init( char *arg ) // If no malloc'd and consumer init ok if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 ) { - // Allow thread to be started/stopped - this->start = consumer_start; - this->is_stopped = consumer_is_stopped; + if ( arg != NULL && strchr( arg, ':' ) ) + { + char *temp = NULL; + int port = atoi( strchr( arg, ':' ) + 1 ); + mlt_properties_set( mlt_consumer_properties( this ), "server", arg ); + temp = mlt_properties_get( mlt_consumer_properties( this ), "server" ); + *( strchr( temp, ':' ) ) = '\0'; + mlt_properties_set_int( mlt_consumer_properties( this ), "port", port ); + } + else + { + mlt_properties_set( mlt_consumer_properties( this ), "server", arg == NULL ? "localhost" : arg ); + mlt_properties_set_int( mlt_consumer_properties( this ), "port", 5250 ); + } - mlt_properties_set( mlt_consumer_properties( this ), "server", arg == NULL ? "localhost" : arg ); - mlt_properties_set_int( mlt_consumer_properties( this ), "port", 5250 ); mlt_properties_set_int( mlt_consumer_properties( this ), "unit", 0 ); mlt_properties_set( mlt_consumer_properties( this ), "command", "append" ); + // Allow thread to be started/stopped + this->start = consumer_start; + this->is_stopped = consumer_is_stopped; + // Return the consumer produced return this; }