- if (stream_config.src.empty()) {
- continue;
- }
-
- string stream_id = stream_config.stream_id;
- string src = stream_config.src;
-
- Input *input = NULL;
- map<string, Input *>::iterator deserialized_input_it =
- deserialized_inputs->find(stream_id);
- if (deserialized_input_it != deserialized_inputs->end()) {
- input = deserialized_input_it->second;
- 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());
- input->close_socket();
- delete input;
- input = NULL;
- }
- deserialized_inputs->erase(deserialized_input_it);
- }
- if (input == NULL) {
- input = create_input(stream_id, src);
- if (input == NULL) {
- fprintf(stderr, "ERROR: did not understand URL '%s', clients will not get any data.\n",
- src.c_str());
- continue;
- }
- }
- input->run();
- inputs.push_back(input);
+ create_config_input(stream_config.src, inputs);
+ }
+ for (unsigned i = 0; i < config.udpstreams.size(); ++i) {
+ const UDPStreamConfig &udpstream_config = config.udpstreams[i];
+ create_config_input(udpstream_config.src, inputs);