From 7a1b214ffee60e2a0e8e03f471bbdee9fc65589a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 20 Jul 2024 23:29:40 +0800 Subject: [PATCH] Monitor (Windows): if current refresh rate is higher than preferred refresh rate, use it. No better methods. I have tried EnumDisplaySettings and winrt DisplayPath::GetModes but none of them work. --- src/detection/monitor/monitor_windows.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/detection/monitor/monitor_windows.c b/src/detection/monitor/monitor_windows.c index 03cc56878..4d9ebed2b 100644 --- a/src/detection/monitor/monitor_windows.c +++ b/src/detection/monitor/monitor_windows.c @@ -103,6 +103,13 @@ const char* ffDetectMonitor(FFlist* results) display->refreshRate = freq.Numerator / (double) freq.Denominator; } } + + DISPLAYCONFIG_VIDEO_SIGNAL_INFO current = modes[path->targetInfo.modeInfoIdx].targetMode.targetVideoSignalInfo; + if (current.activeSize.cx == width && current.activeSize.cy == height) + { + double refreshRate = current.vSyncFreq.Numerator / (double) current.vSyncFreq.Denominator; + if (refreshRate > display->refreshRate) display->refreshRate = refreshRate; + } } } return NULL;