- servers->run();
-
- pthread_t acceptor_thread;
- pthread_create(&acceptor_thread, NULL, acceptor_thread_run, reinterpret_cast<void *>(server_sock));
-
- // Find all streams in the configuration file, and create inputs for them.
- vector<Input *> inputs;
- for (unsigned i = 0; i < config.size(); ++i) {
- if (config[i].keyword != "stream") {
- continue;
- }
- assert(config[i].arguments.size() == 1);
- string stream_id = config[i].arguments[0];
-
- if (config[i].parameters.count("src") == 0) {
- fprintf(stderr, "WARNING: stream '%s' has no src= attribute, clients will not get any data.\n",
- stream_id.c_str());
- continue;
- }
-
- string src = config[i].parameters["src"];
- Input *input = NULL;
- if (deserialized_inputs.count(stream_id) != 0) {
- input = deserialized_inputs[stream_id];
- if (input->get_url() != src) {
- fprintf(stderr, "INFO: Stream '%s' has changed URL from '%s' to '%s', restarting input.\n",
- stream_id.c_str(), input->get_url().c_str(), src.c_str());
- delete input;
- input = NULL;
- }
- deserialized_inputs.erase(stream_id);
- }
- if (input == NULL) {
- input = new Input(stream_id, src);
+ InputStatsThread *input_stats_thread = NULL;
+ if (!config.input_stats_file.empty()) {
+ vector<Input*> inputs_no_refcount;
+ for (multimap<string, InputWithRefcount>::iterator input_it = inputs.begin();
+ input_it != inputs.end(); ++input_it) {
+ inputs_no_refcount.push_back(input_it->second.input);