X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=main.cpp;h=0b8825a9da595b6f36bf7247cd75cfd25bdb619a;hp=ac86e5c5ab56765c034a710be511cc74c470f9c9;hb=029aca758029094d6e9d59e8d88babce94c412e4;hpb=16cc6754518810374f4b486f26646375c4fab12e diff --git a/main.cpp b/main.cpp index ac86e5c..0b8825a 100644 --- a/main.cpp +++ b/main.cpp @@ -477,26 +477,6 @@ start: // Find all streams in the configuration file, create them, and connect to the inputs. create_streams(config, deserialized_urls, &inputs); vector acceptors = create_acceptors(config, &deserialized_acceptors); - - // Convert old-style timestamps to new-style timestamps for all clients; - // this simplifies the sort below. - { - timespec now_monotonic; - if (clock_gettime(CLOCK_MONOTONIC_COARSE, &now_monotonic) == -1) { - log(ERROR, "clock_gettime(CLOCK_MONOTONIC_COARSE) failed."); - exit(1); - } - long delta_sec = now_monotonic.tv_sec - time(NULL); - - for (int i = 0; i < loaded_state.clients_size(); ++i) { - ClientProto* client = loaded_state.mutable_clients(i); - if (client->has_connect_time_old()) { - client->set_connect_time_sec(client->connect_time_old() + delta_sec); - client->set_connect_time_nsec(now_monotonic.tv_nsec); - client->clear_connect_time_old(); - } - } - } // Put back the existing clients. It doesn't matter which server we // allocate them to, so just do round-robin. However, we need to sort them