diff --git a/src/lib.rs b/src/lib.rs index 3b03e1c..12e89b4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -85,6 +85,20 @@ //! | E8xxx | Keydb errors (fetch, parse, load) | //! | E9xxx | Stream / mux errors (URL, PES, pipeline) | +/// Single source of truth for every freemkv version surface. +/// +/// `FREEMKV_VERSION` is the package version, overridable at build time via the +/// `FREEMKV_BUILD_LABEL` env (see `build.rs`); `GIT_SUFFIX` is the git short +/// hash. The CLI's `--version`, the MKV muxing/writing-application field, and +/// the FVI generator tag all derive from these two consts, so a binary reports +/// the exact same label it stamps into the files it produces — no split-brain +/// where an MKV claims one version and the binary another. +pub const VERSION_LABEL: &str = concat!(env!("FREEMKV_VERSION"), env!("GIT_SUFFIX")); + +/// The muxing/writing-application string written into MKV output +/// (`"freemkv (g)"`). +pub const MUX_APP: &str = concat!("freemkv ", env!("FREEMKV_VERSION"), env!("GIT_SUFFIX")); + pub mod aacs; pub(crate) mod clpi; pub mod consts; diff --git a/src/mux/mkv.rs b/src/mux/mkv.rs index e1e355a..fd99cdb 100644 --- a/src/mux/mkv.rs +++ b/src/mux/mkv.rs @@ -773,10 +773,8 @@ impl MkvMuxer { } // 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!("FREEMKV_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)?; + ebml::write_string(&mut writer, ebml::MUXING_APP, crate::MUX_APP)?; + ebml::write_string(&mut writer, ebml::WRITING_APP, crate::MUX_APP)?; if let Some(t) = title { ebml::write_string(&mut writer, ebml::TITLE, t)?; }