Magic-number/taxonomy pass: central wire-format + sector + unit consts

- libfreemkv::consts: coding_type::* (ES coding-type bytes), pes_stream_id::*
  + PAYLOAD_RANGE, SECTOR_BYTES (usize) + SECTOR_BYTES_U64 (offset math)
- replace bare wire-code/sector literals across disc, mpls, clpi, labels,
  m2ts_mux, ps, tsmux, file_sector_source, extract
- remove two unreachable secondary-stream match arms in mpls parse_stream_entry
This commit is contained in:
Matthew Jackson
2026-06-26 13:20:21 -07:00
parent decb87a250
commit d8c323bf9f
11 changed files with 212 additions and 111 deletions
+15 -14
View File
@@ -227,21 +227,22 @@ pub(crate) fn language_display_name(iso: &str) -> String {
/// bytes (the table covers everything the spec defines, but unknown
/// values are still possible on malformed discs).
pub(crate) fn codec_name(coding_type: u8) -> &'static str {
use crate::consts::coding_type as c;
match coding_type {
0x02 => "MPEG-2",
0x1B => "H.264",
0x24 => "HEVC",
0x80 => "LPCM",
0x81 => "AC-3",
0x82 => "DTS",
0x83 => "TrueHD",
0x84 => "AC-3+",
0x85 => "DTS-HD HR", // BD-ROM Part 3-1: 0x85 = DTS-HD High Resolution
0x86 => "DTS-HD MA",
0x90 => "PG",
0x91 => "IG",
0xA1 => "AC-3+ Secondary",
0xA2 => "DTS-HD Secondary",
c::MPEG2_VIDEO => "MPEG-2",
c::H264 => "H.264",
c::HEVC => "HEVC",
c::LPCM => "LPCM",
c::AC3 => "AC-3",
c::DTS => "DTS",
c::TRUEHD => "TrueHD",
c::AC3_PLUS => "AC-3+",
c::DTS_HD_HR => "DTS-HD HR", // BD-ROM Part 3-1: 0x85 = DTS-HD High Resolution
c::DTS_HD_MA => "DTS-HD MA",
c::PG => "PG",
c::IG => "IG",
c::AC3_PLUS_SECONDARY => "AC-3+ Secondary",
c::DTS_HD_SECONDARY => "DTS-HD Secondary",
_ => "",
}
}