From fd543c058bcf334a49d45427fbf04eaf060b54d5 Mon Sep 17 00:00:00 2001 From: MattJackson <1085847+MattJackson@users.noreply.github.com> Date: Sat, 6 Jun 2026 21:32:04 -0700 Subject: [PATCH] mux: rustfmt (Rust 1.86) on touched codec/meta files --- src/mux/codec/h264.rs | 6 +++++- src/mux/codec/hevc.rs | 15 +++++++++++---- src/mux/meta.rs | 4 +++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/mux/codec/h264.rs b/src/mux/codec/h264.rs index 4201123..ef3a1ab 100644 --- a/src/mux/codec/h264.rs +++ b/src/mux/codec/h264.rs @@ -540,7 +540,11 @@ mod tests { let f1 = parser.parse(&make_pes(au1, Some(0))); assert_eq!(f1.len(), 1); // Frame 1 carries only the IDR — param sets stripped (in avcC). - assert_eq!(frame_nal_types(&f1[0].data), vec![5], "AU1: only IDR in-band"); + assert_eq!( + frame_nal_types(&f1[0].data), + vec![5], + "AU1: only IDR in-band" + ); // AU 2: SPS identical to avcC, PPS REDEFINED (same id, different body) + // IDR. The identical SPS is stripped; the redefined PPS must be emitted diff --git a/src/mux/codec/hevc.rs b/src/mux/codec/hevc.rs index 22d359a..2785e6a 100644 --- a/src/mux/codec/hevc.rs +++ b/src/mux/codec/hevc.rs @@ -813,8 +813,7 @@ mod tests { let count_pps = |fd: &[u8]| { let (mut n, mut o) = (0usize, 0usize); while o + 4 <= fd.len() { - let len = - u32::from_be_bytes([fd[o], fd[o + 1], fd[o + 2], fd[o + 3]]) as usize; + let len = u32::from_be_bytes([fd[o], fd[o + 1], fd[o + 2], fd[o + 3]]) as usize; o += 4; if o < fd.len() && (fd[o] >> 1) & 0x3F == 34 { n += 1; @@ -843,13 +842,21 @@ mod tests { let mut d = pps(0xBB); d.extend(slice()); let f = parser.parse(&make_pes(d, Some(2))); - assert_eq!(count_pps(&f[0].data), 1, "redefined PPS re-emitted every occurrence"); + assert_eq!( + count_pps(&f[0].data), + 1, + "redefined PPS re-emitted every occurrence" + ); // PES4: back to PPS-A (== codecPrivate) → stripped (hvcC supplies it). let mut d = pps(0xAA); d.extend(slice()); let f = parser.parse(&make_pes(d, Some(3))); - assert_eq!(count_pps(&f[0].data), 0, "occurrence equal to codecPrivate stripped"); + assert_eq!( + count_pps(&f[0].data), + 0, + "occurrence equal to codecPrivate stripped" + ); } // --- empty PES --- diff --git a/src/mux/meta.rs b/src/mux/meta.rs index 519e880..8c66e2e 100644 --- a/src/mux/meta.rs +++ b/src/mux/meta.rs @@ -3,7 +3,9 @@ //! Format: [8B magic] [4B json_len] [JSON] [padding to 192B boundary] [BD-TS data...] //! Other tools skip the header during TS sync recovery (scan for 0x47). -use crate::disc::{AudioStream, ColorSpace, DiscTitle, HdrFormat, Stream, SubtitleStream, VideoStream}; +use crate::disc::{ + AudioStream, ColorSpace, DiscTitle, HdrFormat, Stream, SubtitleStream, VideoStream, +}; use serde::{Deserialize, Serialize}; use std::io::{self, Read, Write};