mux: collapse FviSink::create/create_with_source into one create
create_with_source (full SourceInfo) was only ever called by the create wrapper with a partial SourceInfo — the extra capability was unused (YAGNI). Inlined the constructor body into create and deleted the _with_source variant; callers unchanged.
This commit is contained in:
+4
-16
@@ -157,31 +157,19 @@ impl FviSink {
|
|||||||
///
|
///
|
||||||
/// `source_path` / `source_title` record where the index was built from
|
/// `source_path` / `source_title` record where the index was built from
|
||||||
/// (the input URL path + the 0-based title index); they are carried into the
|
/// (the input URL path + the 0-based title index); they are carried into the
|
||||||
/// header's `source` object. The medium defaults to `file` — callers with a
|
/// header's `source` object. The remaining provenance (medium, playlist,
|
||||||
/// known medium / playlist / volume use [`FviSink::create_with_source`].
|
/// volume) takes its `SourceInfo` defaults — no caller needs to override them.
|
||||||
pub fn create(
|
pub fn create(
|
||||||
path: &Path,
|
path: &Path,
|
||||||
title: &DiscTitle,
|
title: &DiscTitle,
|
||||||
source_path: String,
|
source_path: String,
|
||||||
source_title: usize,
|
source_title: usize,
|
||||||
) -> io::Result<Self> {
|
) -> io::Result<Self> {
|
||||||
Self::create_with_source(
|
let source = SourceInfo {
|
||||||
path,
|
|
||||||
title,
|
|
||||||
SourceInfo {
|
|
||||||
path: source_path,
|
path: source_path,
|
||||||
title: source_title,
|
title: source_title,
|
||||||
..SourceInfo::default()
|
..SourceInfo::default()
|
||||||
},
|
};
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create the sink with a fully-specified [`SourceInfo`] provenance root.
|
|
||||||
pub fn create_with_source(
|
|
||||||
path: &Path,
|
|
||||||
title: &DiscTitle,
|
|
||||||
source: SourceInfo,
|
|
||||||
) -> io::Result<Self> {
|
|
||||||
let file = File::create(path)?;
|
let file = File::create(path)?;
|
||||||
|
|
||||||
let video_track = title
|
let video_track = title
|
||||||
|
|||||||
+1
-2
@@ -531,8 +531,7 @@ pub fn output(
|
|||||||
// `fvi://` writes the per-picture video index (`docs/FVI_FORMAT.md`).
|
// `fvi://` writes the per-picture video index (`docs/FVI_FORMAT.md`).
|
||||||
// The bare `output()` arm records the resolver path as the provenance
|
// The bare `output()` arm records the resolver path as the provenance
|
||||||
// `source.path` and defaults the title index to 0 (the resolver carries
|
// `source.path` and defaults the title index to 0 (the resolver carries
|
||||||
// no title-index context — the CLI follow-up passes the real medium /
|
// no title-index context).
|
||||||
// title via `FviSink::create_with_source`).
|
|
||||||
StreamUrl::Fvi { ref path } => {
|
StreamUrl::Fvi { ref path } => {
|
||||||
validate_file_path(path, "fvi")?;
|
validate_file_path(path, "fvi")?;
|
||||||
Ok(Box::new(super::fvi_sink::FviSink::create(
|
Ok(Box::new(super::fvi_sink::FviSink::create(
|
||||||
|
|||||||
Reference in New Issue
Block a user