v0.25.2: DTS-HD codec ID + PGS BlockDuration

- MkvTrack::audio emits A_DTS/MA, A_DTS/HR, A_DTS per the DTS family
  instead of mislabelling everything as A_DTS. Plex transcoder and
  strict hardware decoders reject DTS-HD MA payload under a plain
  A_DTS track.
- PgsParser is now stateful: pairs display PCS with the following
  empty PCS to compute a duration. Frame::duration_ns + PesFrame::duration_ns
  carry it through; MkvMuxer::write_frame gains a final Option<u64>
  parameter that emits BlockGroup + BlockDuration when set. Fixes
  subtitle bitmaps lingering past their intended end-time.
This commit is contained in:
MattJackson
2026-05-19 16:11:54 -07:00
parent 7dcac44136
commit 1b95193517
24 changed files with 376 additions and 48 deletions
+6
View File
@@ -301,6 +301,7 @@ fn m2ts_stream_write_read() {
pts: i as i64 * 1_000_000,
keyframe: i == 0,
data: vec![i; 100],
duration_ns: None,
};
PesStream::write(&mut stream, &frame).unwrap();
}
@@ -322,6 +323,7 @@ fn m2ts_pes_frame_roundtrip() {
pts: 1_234_567_890,
keyframe: true,
data: vec![0xDE; 200],
duration_ns: None,
};
let mut buf = Vec::new();
@@ -589,6 +591,7 @@ fn mkvstream_write_finish() {
pts: i as i64 * 1_000_000,
keyframe: i == 0,
data: vec![i; 100],
duration_ns: None,
};
PesStream::write(&mut stream, &frame).unwrap();
}
@@ -650,6 +653,7 @@ fn mkvstream_roundtrip_bdts() {
pts: i as i64 * 1_000_000,
keyframe: true,
data: vec![i; 100],
duration_ns: None,
};
PesStream::write(&mut stream, &frame).unwrap();
}
@@ -842,6 +846,7 @@ fn mkvstream_e2e_h264_produces_valid_mkv() {
pts: 1_000_000_000, // 1 second in ns
keyframe: true,
data: es_data,
duration_ns: None,
};
PesStream::write(&mut stream2, &frame1).unwrap();
@@ -851,6 +856,7 @@ fn mkvstream_e2e_h264_produces_valid_mkv() {
pts: 1_041_700_000, // ~1 frame later in ns
keyframe: false,
data: es_data2,
duration_ns: None,
};
PesStream::write(&mut stream2, &frame2).unwrap();
PesStream::finish(&mut stream2).unwrap();