From 64bcb35c49817f60893a23bd554fa148e3ddf7b6 Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Fri, 6 Oct 2023 12:44:30 +0500 Subject: [PATCH] fix re-skipping already skipped header --- src/demux/flv.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/demux/flv.rs b/src/demux/flv.rs index 80239e6..b023383 100644 --- a/src/demux/flv.rs +++ b/src/demux/flv.rs @@ -40,7 +40,7 @@ impl FLVReader { fn skip_init_header(&mut self) -> Result<(), Box> { let mut rest_of_header = [0u8; 5]; 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]; self.stdin.read_exact(skip_header_extra.as_mut_slice())?; return Ok(());