libfreemkv: rc.5.1 DVD correctness fixes

- CSS: unlock scrambled-sector reads on enforcing drives via bus-auth
  only; classify sense 6F/03 as CSS-locked; early-bail on a fully locked
  scan; gate the AACS handshake off DVD discs.
- DVD first-play menu no longer prepended to the feature: read the title
  VOBS base from vtstt_vobs (0xC4), not the menu VOBS vtsm_vobs (0xC0).
- Interlaced field-duration (DefaultDecodedFieldDuration) written as a
  direct TrackEntry child rather than inside Video, so Windows reports
  the correct frame rate.
- Audio channel count read from the AC-3 bitstream; FieldOrder set to
  TFF; per-track BPS tags.
- Structured disc diagnostics at --log-level 3; reduced per-operation
  log spam.
This commit is contained in:
Matthew Jackson
2026-06-24 14:34:55 -07:00
parent 315276dd13
commit 6592f2a590
18 changed files with 1938 additions and 120 deletions
+22 -1
View File
@@ -101,6 +101,13 @@ pub(crate) struct WritebackFile {
file: File,
pipeline: WritebackPipeline,
pos: u64,
/// Count of position-moving seeks (for the finalize summary). The MKV muxer
/// seeks back occasionally (cluster size patching, Cues, Segment header
/// backpatch); the per-seek DEBUG line is trace-level now, and this rolls
/// the total into one finalize summary.
seek_count: u64,
/// Sum of |delta| over all position-moving seeks, in bytes.
seek_bytes: u64,
}
impl WritebackFile {
@@ -115,6 +122,8 @@ impl WritebackFile {
file,
pipeline,
pos,
seek_count: 0,
seek_bytes: 0,
})
}
@@ -176,6 +185,14 @@ impl WritebackFile {
/// then external commit/DB update) must not treat `Ok(())` as a
/// durability barrier.
pub(crate) fn sync_all(&mut self) -> io::Result<()> {
if self.seek_count > 0 {
tracing::debug!(
target: "mux",
"WritebackFile finalize: {} seeks, {} bytes seeked total",
self.seek_count,
self.seek_bytes
);
}
self.pipeline.finalize();
platform::durable_sync(&self.file)
}
@@ -219,10 +236,14 @@ impl Seek for WritebackFile {
let from_pos = self.pos;
let to_pos = p;
let delta: i64 = (to_pos as i64).wrapping_sub(from_pos as i64);
tracing::debug!(
// Per-seek detail is trace-level (L4) — benign and high-frequency.
// The aggregate (count + total bytes) is logged once at finalize.
tracing::trace!(
target: "mux",
"WritebackFile seek from={from_pos} to={to_pos} delta={delta}"
);
self.seek_count += 1;
self.seek_bytes += delta.unsigned_abs();
self.pipeline.handle_seek(p);
self.pos = p;
}