fix: Increase width tolerance for frame class matching to accommodate ultrawide aspect ratios

This commit is contained in:
sHa
2026-01-02 12:43:55 +00:00
parent 981000793f
commit a85ecdb52d
2 changed files with 8 additions and 1 deletions

View File

@@ -90,10 +90,11 @@ class MediaInfoExtractor:
effective_height = height
# First, try to match width to typical widths
# Use a larger tolerance (10 pixels) to handle cinema/ultrawide aspect ratios
width_matches = []
for frame_class, info in FRAME_CLASSES.items():
for tw in info['typical_widths']:
if abs(width - tw) <= 5 and frame_class.endswith(scan_type):
if abs(width - tw) <= 10 and frame_class.endswith(scan_type):
diff = abs(height - info['nominal_height'])
width_matches.append((frame_class, diff))

View File

@@ -148,5 +148,11 @@
"interlaced": false,
"expected_frame_class": "1080p",
"testname": "test-mistakenly-high-height"
},
{
"resolution": [1912,798],
"interlaced": false,
"expected_frame_class": "1080p",
"testname": "test-mistakenly-high-height-2"
}
]