When startup_wait_s is non-zero, anything dependent upon initial timestamps (e.g., the reflector timeout period) will be affected by the sleep. If the reflector timeout period is less than the startup_wait_s duration. this causes a fatal crash immediately after the startup sleep ends.
This is addressed by sleeping before assigning any initial timestamps.
@joshuawn many thanks indeed for submitting this pull request. I was able to recreate the issue and your proposed fix resolved it. And otherwise I agree with where you have relocated the startup delay code.
When startup_wait_s is non-zero, anything dependent upon initial timestamps (e.g., the reflector timeout period) will be affected by the sleep. If the reflector timeout period is less than the startup_wait_s duration. this causes a fatal crash immediately after the startup sleep ends. This is addressed by sleeping before assigning any initial timestamps.