Hd-rum-translator: not start control by default

This commit is contained in:
Martin Pulec
2017-03-17 11:08:54 +01:00
parent ce48814a84
commit 00ab02fb58
2 changed files with 7 additions and 7 deletions

View File

@@ -54,8 +54,6 @@
struct control_state;
struct module;
#define CONTROL_DEFAULT_PORT 5054
/**
* @retval 0 if success
*/

View File

@@ -476,7 +476,7 @@ struct cmdline_parameters {
unsigned short port;
vector<struct host_opts> hosts;
int host_count;
int control_port = CONTROL_DEFAULT_PORT;
int control_port = -1;
int control_connection_type = 0;
struct hd_rum_output_conf out_conf = {NORMAL, 0, 0, 0};
const char *capture_filter = NULL;
@@ -711,11 +711,13 @@ int main(int argc, char **argv)
state.replicas.resize(params.host_count);
if(control_init(params.control_port, params.control_connection_type, &state.control_state, &state.mod) != 0) {
fprintf(stderr, "Warning: Unable to create remote control.\n");
return EXIT_FAILURE;
if (params.control_port != -1) {
if(control_init(params.control_port, params.control_connection_type, &state.control_state, &state.mod) != 0) {
fprintf(stderr, "Warning: Unable to create remote control.\n");
return EXIT_FAIL_CONTROL_SOCK;
}
control_start(state.control_state);
}
control_start(state.control_state);
// we need only one shared receiver decompressor for all recompressing streams
state.decompress = hd_rum_decompress_init(&state.mod, params.out_conf, params.capture_filter);