mux: fix non-monotonic audio DTS (TrueHD + DTS-HD MA) and stamp builds with git hash

TrueHD: when the PES PTS lags the access-unit cadence, resync to the PTS
but never snap the running timestamp backward, so the emitted DTS stays
monotonic across the resync (next_pts_ns = max(next_pts_ns, pts)).

DTS-HD MA: size each EXSS extension substream exactly from its header
(exss_frame_size) and skip it as a unit, so a false 0x7FFE8001 core sync
inside the lossless extension payload can no longer split the access unit
and truncate the extension. Falls back to a bounded scan when the header
is unparseable.

Provenance: build.rs bakes the git short hash into GIT_SUFFIX; the muxing/
writing-application field and the FVI generator tag now record the exact
build (e.g. "freemkv 1.1.0-beta.1 (g835cc99)"), so any output file is
traceable to the revision that produced it.
This commit is contained in:
Matthew Jackson
2026-06-26 19:26:24 -07:00
parent afa218fc8f
commit c49a180ce7
5 changed files with 234 additions and 12 deletions
+2 -1
View File
@@ -773,7 +773,8 @@ impl<W: Write + Seek> MkvMuxer<W> {
}
// Stamp the freemkv version so any muxed file is traceable to the build
// that produced it (MediaInfo "Writing application"/"library").
const FREEMKV_MUX_APP: &str = concat!("freemkv ", env!("CARGO_PKG_VERSION"));
const FREEMKV_MUX_APP: &str =
concat!("freemkv ", env!("CARGO_PKG_VERSION"), env!("GIT_SUFFIX"));
ebml::write_string(&mut writer, ebml::MUXING_APP, FREEMKV_MUX_APP)?;
ebml::write_string(&mut writer, ebml::WRITING_APP, FREEMKV_MUX_APP)?;
if let Some(t) = title {