libobs: Fix warnings about type usage
parent
5e3c824801
commit
92d1ca41cc
|
@ -1027,7 +1027,7 @@ struct obs_output {
|
||||||
int reconnect_retry_sec;
|
int reconnect_retry_sec;
|
||||||
int reconnect_retry_max;
|
int reconnect_retry_max;
|
||||||
int reconnect_retries;
|
int reconnect_retries;
|
||||||
uint64_t reconnect_retry_cur_msec;
|
uint32_t reconnect_retry_cur_msec;
|
||||||
float reconnect_retry_exp;
|
float reconnect_retry_exp;
|
||||||
pthread_t reconnect_thread;
|
pthread_t reconnect_thread;
|
||||||
os_event_t *reconnect_stop_event;
|
os_event_t *reconnect_stop_event;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#define get_weak(output) ((obs_weak_output_t *)output->context.control)
|
#define get_weak(output) ((obs_weak_output_t *)output->context.control)
|
||||||
|
|
||||||
#define RECONNECT_RETRY_MAX_MSEC (15 * 60 * 1000)
|
#define RECONNECT_RETRY_MAX_MSEC (15 * 60 * 1000)
|
||||||
#define RECONNECT_RETRY_BASE_EXP 1.5
|
#define RECONNECT_RETRY_BASE_EXP 1.5f
|
||||||
|
|
||||||
static inline bool active(const struct obs_output *output)
|
static inline bool active(const struct obs_output *output)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +150,7 @@ obs_output_t *obs_output_create(const char *id, const char *name,
|
||||||
output->reconnect_retry_sec = 2;
|
output->reconnect_retry_sec = 2;
|
||||||
output->reconnect_retry_max = 20;
|
output->reconnect_retry_max = 20;
|
||||||
output->reconnect_retry_exp =
|
output->reconnect_retry_exp =
|
||||||
RECONNECT_RETRY_BASE_EXP + (rand_float(0) * 0.05);
|
RECONNECT_RETRY_BASE_EXP + (rand_float(0) * 0.05f);
|
||||||
output->valid = true;
|
output->valid = true;
|
||||||
|
|
||||||
obs_context_init_control(&output->context, output,
|
obs_context_init_control(&output->context, output,
|
||||||
|
@ -2398,10 +2398,14 @@ static void output_reconnect(struct obs_output *output)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output->reconnect_retries) {
|
if (output->reconnect_retries) {
|
||||||
output->reconnect_retry_cur_msec *= output->reconnect_retry_exp;
|
output->reconnect_retry_cur_msec =
|
||||||
if (output->reconnect_retry_cur_msec > RECONNECT_RETRY_MAX_MSEC)
|
(uint32_t)(output->reconnect_retry_cur_msec *
|
||||||
|
output->reconnect_retry_exp);
|
||||||
|
if (output->reconnect_retry_cur_msec >
|
||||||
|
RECONNECT_RETRY_MAX_MSEC) {
|
||||||
output->reconnect_retry_cur_msec =
|
output->reconnect_retry_cur_msec =
|
||||||
RECONNECT_RETRY_MAX_MSEC;
|
RECONNECT_RETRY_MAX_MSEC;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output->reconnect_retries++;
|
output->reconnect_retries++;
|
||||||
|
|
Loading…
Reference in New Issue