Don't do AR changes on negative aspect ratios

This commit is contained in:
Tamius Han 2025-04-22 02:44:28 +02:00
parent 391b0ac7ab
commit 73aa925067
3 changed files with 14 additions and 3 deletions

View File

@ -687,7 +687,13 @@ export class Aard {
// if detected aspect ratio is different from the current aspect ratio
// if (this.testResults.aspectRatioUpdated) {
// this.timer.arChanged();
this.updateAspectRatio();
const finalAr = this.getAr();
if (finalAr > 0) {
this.updateAspectRatio(finalAr);
} else {
this.testResults.aspectRatioInvalid = true;
this.testResults.aspectRatioInvalidReason = finalAr.toFixed(3);
}
// }
// if we got "no letterbox" OR aspectRatioUpdated

View File

@ -370,7 +370,8 @@ export class AardDebugUi {
out = `${out}
-- UNCERTAIN FLAGS
AR: ${testResults.aspectRatioUncertain} (reason: ${testResults.aspectRatioUncertainReason ?? 'n/a'}); top row: ${testResults.topRowUncertain}; bottom row: ${testResults.bottomRowUncertain}
AR: ${testResults.aspectRatioUncertain} (reason: ${testResults.aspectRatioUncertainReason ?? 'n/a'}); top row: ${testResults.topRowUncertain}; bottom row: ${testResults.bottomRowUncertain}${
testResults.aspectRatioInvalid ? `\nINVALID_AR (reason: ${testResults.aspectRatioInvalidReason ?? 'n/a'})` : ''}
-- GUARD & IMAGE LINE
bottom guard: ${testResults.guardLine.bottom} image: ${testResults.guardLine.invalidated ? 'n/a' : testResults.imageLine.bottom}

View File

@ -39,7 +39,9 @@ export interface AardTestResults {
letterboxWidth: number,
letterboxOffset: number,
logoDetected: [boolean, boolean, boolean, boolean]
aspectRatioInvalid: boolean
aspectRatioUncertainReason?: string
aspectRatioInvalidReason?: string
}
export function initAardTestResults(settings: AardSettings): AardTestResults {
@ -81,7 +83,8 @@ export function initAardTestResults(settings: AardSettings): AardTestResults {
activeAspectRatio: 0,
letterboxWidth: 0,
letterboxOffset: 0,
logoDetected: [false, false, false, false]
logoDetected: [false, false, false, false],
aspectRatioInvalid: false,
}
}
@ -120,4 +123,5 @@ export function resetAardTestResults(results: AardTestResults): void {
results.aspectRatioUncertainReason = null;
results.topRowUncertain = false;
results.bottomRowUncertain = false;
results.aspectRatioInvalid = false;
}