Simplify some preferred refresh rate logic

This commit is contained in:
Patrick Nicolas
2026-04-19 09:14:03 +02:00
parent 71a9793f9a
commit 6d072e30cd
4 changed files with 9 additions and 16 deletions
+2 -1
View File
@@ -781,8 +781,9 @@ void compositor::set_bitrate(uint32_t bitrate)
void compositor::set_refresh_rate(float hz)
{
if (refresh_rate.exchange(hz) == hz)
return;
U_LOG_IFL_D(log_level, "Refresh rate change from %.0f to %.0f", refresh_rate.load(), hz);
refresh_rate = hz;
pacer.set_frame_duration(U_TIME_1S_IN_NS / hz);
for (auto & encoder: encoders)
encoder->set_framerate(hz);