UI: Force minimum reconnect delay of 1 second

Setting this to zero breaks reconnecting (and OBS) entirely as various
parts of the reconnect system do not handle zero values properly, and
there are also possible race conditions with the reconnect thread. Set a
minimum of 1 second to avoid this.
This commit is contained in:
Richard Stanway 2021-09-15 20:16:07 +02:00 committed by Jim
parent 8265a8653f
commit 422a206371
2 changed files with 14 additions and 0 deletions

View file

@ -5285,6 +5285,9 @@
<property name="suffix">
<string> s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</number>
</property>

View file

@ -1372,6 +1372,17 @@ bool OBSBasic::InitBasicConfigDefaults()
changed = true;
}
/* ----------------------------------------------------- */
/* enforce minimum retry delay of 1 second prior to 27.1 */
if (config_has_user_value(basicConfig, "Output", "RetryDelay")) {
int retryDelay =
config_get_uint(basicConfig, "Output", "RetryDelay");
if (retryDelay < 1) {
config_set_uint(basicConfig, "Output", "RetryDelay", 1);
changed = true;
}
}
/* ----------------------------------------------------- */
if (changed)