fix(tracks): match probed hdr10p tracks on remote and hint dv+hdr10p on -r HDR10P

match_track treats HDR10 and HDR10P as equal in its attribute fallback. -r HDR10P warns that a DV track carries HDR10+ when one does.
This commit is contained in:
imSp4rky
2026-10-18 12:24:10 -06:00
parent 6fdfeb9cae
commit 2dd2046d65
3 changed files with 17 additions and 2 deletions
@@ -176,6 +176,14 @@ def test_match_track_by_attributes_keeps_range_and_bitrate_apart() -> None:
assert match_track(remote, [sdr, hdr]) is hdr
def test_match_track_by_attributes_matches_probed_hdr10p_to_local_hdr10() -> None:
common = {"codec": "HEVC", "width": 3840, "height": 2160, "language": "en", "bitrate": 15000000}
sdr = deserialize_video({**common, "id": "a", "range": "SDR"})
hdr10 = deserialize_video({**common, "id": "b", "range": "HDR10"})
remote = deserialize_video({**common, "id": "z", "range": "HDR10P"})
assert match_track(remote, [sdr, hdr10]) is hdr10
def test_match_track_no_candidates_returns_none() -> None:
remote = deserialize_video({"id": "X", "codec": "AVC", "width": 1, "height": 1})
assert match_track(remote, []) is None