Move codec_privates onto DiscTitle, eliminate duplicate methods
Design fix: codec_privates are now a field on DiscTitle, not a separate parameter passed through the pipeline. This eliminates the root cause of the network codec_private bug (forgot to pass the separate param). API changes: - output() takes (url, &DiscTitle) — no separate codec_privates param - MkvOutputStream::create, M2tsOutputStream::create, NetworkOutputStream::connect all read codec_privates from title.codec_privates - M2tsMeta::from_title() takes only &DiscTitle — reads privates from title - Deleted from_title_with_privates (was the wrong-name duplicate) - Merged read_header + read_header_from_stream into one read_header(impl Read) - Deleted finish(self) from TsMuxer, keep only finish(&mut self) Rule: ONE public method per action. No _with_X, _from_Y, _ref variants.
This commit is contained in:
+3
-2
@@ -58,8 +58,8 @@ impl NetworkStream {
|
||||
stream.set_nodelay(true)?;
|
||||
let mut reader = BufReader::with_capacity(NET_BUF_SIZE, stream);
|
||||
|
||||
// Read FMKV metadata header (inline, since TcpStream doesn't impl Seek)
|
||||
let disc_title = meta::read_header_from_stream(&mut reader)?
|
||||
// Read FMKV metadata header
|
||||
let disc_title = meta::read_header(&mut reader)?
|
||||
.ok_or_else(|| {
|
||||
io::Error::new(
|
||||
io::ErrorKind::InvalidData,
|
||||
@@ -149,6 +149,7 @@ mod tests {
|
||||
chapters: Vec::new(),
|
||||
extents: Vec::new(),
|
||||
content_format: ContentFormat::BdTs,
|
||||
codec_privates: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user