Follow-up to #642 (closed via #647). Same silent-drift class as #576.
hls/format_detection.rs:69-71 classifies an HLS format id into a codec by substring sniffing:
} else if id.contains("aac") || id.contains("mp4a") {
Some("aac".to_string())
} else if id.contains("opus") {
#642 typed the values these produce but left the classification untouched.
Why it's a defect, not just style
Substring matching is the same hazard #576 documented for hand-repeated alias lists: nothing enforces the mapping is complete or mutually exclusive, and an id that merely contains a token gets classified. It is also the last production site still deciding codec identity from raw string fragments now that container_matches resolves aliases through the registry.
Suggested shape
Resolve through the registry's alias mechanism (CodecRow::aliases(), extended to video rows in #647) rather than substring tests, so identity lives in one place. Keep the set open — unknown id must remain unclassified, not forced into a default.
Acceptance
Follow-up to #642 (closed via #647). Same silent-drift class as #576.
hls/format_detection.rs:69-71classifies an HLS format id into a codec by substring sniffing:#642 typed the values these produce but left the classification untouched.
Why it's a defect, not just style
Substring matching is the same hazard #576 documented for hand-repeated alias lists: nothing enforces the mapping is complete or mutually exclusive, and an id that merely contains a token gets classified. It is also the last production site still deciding codec identity from raw string fragments now that
container_matchesresolves aliases through the registry.Suggested shape
Resolve through the registry's alias mechanism (
CodecRow::aliases(), extended to video rows in #647) rather than substring tests, so identity lives in one place. Keep the set open — unknown id must remain unclassified, not forced into a default.Acceptance
.contains()on a codec id.