Check XR_FB_display_refresh_rate before using it

This commit is contained in:
Patrick Nicolas
2024-08-27 09:10:38 +02:00
parent d267bd0ebb
commit 9ef09256e8
4 changed files with 23 additions and 13 deletions
+9 -6
View File
@@ -869,13 +869,16 @@ void scenes::stream::setup(const to_headset::video_stream_description & descript
{
spdlog::info("Creating decoder size {}x{} offset {},{}", item.width, item.height, item.offset_x, item.offset_y);
try
if (instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
{
session.set_refresh_rate(description.fps);
}
catch (std::exception & e)
{
spdlog::warn("Failed to set refresh rate to {}: {}", description.fps, e.what());
try
{
session.set_refresh_rate(description.fps);
}
catch (std::exception & e)
{
spdlog::warn("Failed to set refresh rate to {}: {}", description.fps, e.what());
}
}
accumulator_images dec;