module-rt: fall back to some defaults in case of error

This commit is contained in:
Wim Taymans 2023-07-20 15:57:31 +02:00
parent 7b24b3b687
commit 163fde0a69

View file

@ -968,11 +968,20 @@ static int do_rtkit_setup(struct spa_loop *loop, bool async, uint32_t seq,
}
}
/* get some properties */
if (rtkit_get_int_property(impl, "MaxRealtimePriority", &retval) >= 0)
if (rtkit_get_int_property(impl, "MaxRealtimePriority", &retval) < 0) {
retval = 1;
pw_log_warn("RTKit does not give us MaxRealtimePriority, using %lld", retval);
}
impl->max_rtprio = retval;
if (rtkit_get_int_property(impl, "MinNiceLevel", &retval) >= 0)
if (rtkit_get_int_property(impl, "MinNiceLevel", &retval) < 0) {
retval = 0;
pw_log_warn("RTKit does not give us MinNiceLevel, using %lld", retval);
}
impl->min_nice_level = retval;
if (rtkit_get_int_property(impl, "RTTimeUSecMax", &retval) >= 0)
if (rtkit_get_int_property(impl, "RTTimeUSecMax", &retval) < 0) {
retval = impl->rl.rlim_cur;
pw_log_warn("RTKit does not give us RTTimeUSecMax, using %lld", retval);
}
impl->rttime_max = retval;
/* Retry set_nice with rtkit */