From 8cf1a98c3393a91d6f6171951d3b3e4ac9a58e3d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 23 Sep 2025 17:33:44 +0200 Subject: [PATCH] Codec resolution check: treat 0, 0 as no limit Some devices such as Intel Xeon E3-1200 don't report max video resolution. In such cases assume there is no limit and instead let ffmepg (vaapi) fail when recording, if the resolution isn't supported. --- src/codec_query/vaapi.c | 2 +- src/main.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/codec_query/vaapi.c b/src/codec_query/vaapi.c index 6f36eab..0943450 100644 --- a/src/codec_query/vaapi.c +++ b/src/codec_query/vaapi.c @@ -87,7 +87,7 @@ static vec2i profile_entrypoint_get_max_resolution(VADisplay va_dpy, VAProfile p .type = VAConfigAttribMaxPictureHeight, } }; - if(vaGetConfigAttributes(va_dpy, profile, entrypoint, attribs, 2) != VA_STATUS_SUCCESS) + if(vaGetConfigAttributes(va_dpy, profile, entrypoint, attribs, 2) != VA_STATUS_SUCCESS || (attribs[0].value & VA_ATTRIB_NOT_SUPPORTED) || (attribs[1].value & VA_ATTRIB_NOT_SUPPORTED)) return (vec2i){0, 0}; return (vec2i){ attribs[0].value, attribs[1].value }; diff --git a/src/main.cpp b/src/main.cpp index f93a363..6e11d25 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2701,6 +2701,8 @@ static vec2i codec_get_max_resolution(gsr_video_codec video_codec, bool use_soft } static bool codec_supports_resolution(vec2i codec_max_resolution, vec2i capture_resolution) { + if(codec_max_resolution.x == 0 || codec_max_resolution.y == 0) + return true; return codec_max_resolution.x >= capture_resolution.x && codec_max_resolution.y >= capture_resolution.y; }