- 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;
+
+ if (deserialized_urls.count(stream_config.url) == 0) {
+ stream_index = servers->add_stream(stream_config.url,
+ stream_config.backlog_size,
+ stream_config.prebuffering_bytes,
+ Stream::Encoding(stream_config.encoding),
+ Stream::Encoding(stream_config.src_encoding));
+ } else {
+ stream_index = servers->lookup_stream_by_url(stream_config.url);
+ assert(stream_index != -1);
+ servers->set_backlog_size(stream_index, stream_config.backlog_size);
+ servers->set_prebuffering_bytes(stream_index, stream_config.prebuffering_bytes);
+ servers->set_encoding(stream_index,
+ Stream::Encoding(stream_config.encoding));
+ servers->set_src_encoding(stream_index,
+ Stream::Encoding(stream_config.src_encoding));
+ }
+
+ servers->set_pacing_rate(stream_index, stream_config.pacing_rate);
+
+ string src = stream_config.src;
+ Input::Encoding src_encoding = Input::Encoding(stream_config.src_encoding);
+ if (!src.empty()) {
+ const auto input_it = inputs->find(make_pair(src, src_encoding));
+ if (input_it != inputs->end()) {
+ input_it->second.input->add_destination(stream_index);
+ ++input_it->second.refcount;