Drop unknown elements when building header
This commit is contained in:
parent
bf0f727b03
commit
4970603236
2 changed files with 4 additions and 1 deletions
|
@ -125,6 +125,7 @@ impl<S: EbmlEventSource> Stream for WebmChunker<S>
|
|||
},
|
||||
Ok(Async::Ready(Some(WebmElement::Info))) => {},
|
||||
Ok(Async::Ready(Some(WebmElement::Void))) => {},
|
||||
Ok(Async::Ready(Some(WebmElement::Unknown(_)))) => {},
|
||||
Ok(Async::Ready(Some(element))) => {
|
||||
match encode_webm_element(element, buffer) {
|
||||
Ok(_) => {},
|
||||
|
|
|
@ -123,7 +123,9 @@ pub fn encode_webm_element<T: Write + Seek>(element: WebmElement, output: &mut T
|
|||
WebmElement::Cluster => encode_tag_header(CLUSTER_ID, Varint::Unknown, output),
|
||||
WebmElement::Timecode(time) => encode_integer(TIMECODE_ID, time, output),
|
||||
WebmElement::SimpleBlock(block) => encode_simple_block(block, output),
|
||||
_ => Err(IoError::new(ErrorKind::InvalidInput, WriteError::OutOfRange))
|
||||
WebmElement::Void => Err(IoError::new(ErrorKind::InvalidInput, WriteError::OutOfRange)),
|
||||
WebmElement::Info => Err(IoError::new(ErrorKind::InvalidInput, WriteError::OutOfRange)),
|
||||
WebmElement::Unknown(_) => Err(IoError::new(ErrorKind::InvalidInput, WriteError::OutOfRange))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue