fix re-skipping already skipped header
This commit is contained in:
parent
a27ecba29b
commit
64bcb35c49
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ impl FLVReader {
|
||||||
fn skip_init_header(&mut self) -> Result<(), Box<dyn Error>> {
|
fn skip_init_header(&mut self) -> Result<(), Box<dyn Error>> {
|
||||||
let mut rest_of_header = [0u8; 5];
|
let mut rest_of_header = [0u8; 5];
|
||||||
self.stdin.read_exact(&mut rest_of_header)?;
|
self.stdin.read_exact(&mut rest_of_header)?;
|
||||||
let head_offset = u32::from_be_bytes(rest_of_header[1..].try_into()?) as usize + 4;
|
let head_offset = u32::from_be_bytes(rest_of_header[1..].try_into()?) as usize - 9 + 4;
|
||||||
let mut skip_header_extra = vec![0u8; head_offset];
|
let mut skip_header_extra = vec![0u8; head_offset];
|
||||||
self.stdin.read_exact(skip_header_extra.as_mut_slice())?;
|
self.stdin.read_exact(skip_header_extra.as_mut_slice())?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|
Loading…
Reference in a new issue