From b0b4f204f2e78f861923de34ceb183441224e059 Mon Sep 17 00:00:00 2001 From: Tangent 128 Date: Wed, 4 Oct 2017 02:03:19 -0400 Subject: [PATCH] strip out extra header chunks in timecode_fixer() --- src/timecode_fixer.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/timecode_fixer.rs b/src/timecode_fixer.rs index 5f380a9..f701fd2 100644 --- a/src/timecode_fixer.rs +++ b/src/timecode_fixer.rs @@ -49,6 +49,7 @@ pub struct ChunkTimecodeFixer { current_offset: u64, last_observed_timecode: u64, assumed_duration: u64, + seen_header: bool } impl> Stream for ChunkTimecodeFixer @@ -70,6 +71,13 @@ impl> Stream for ChunkTimecodeFixer } self.last_observed_timecode = end + self.current_offset; }, + Ok(Async::Ready(Some(Chunk::Headers {..}))) => { + if self.seen_header { + return self.poll(); + } else { + self.seen_header = true; + } + }, _ => {} }; poll_chunk @@ -86,7 +94,8 @@ impl> ChunkStream for T { stream: self, current_offset: 0, last_observed_timecode: 0, - assumed_duration: 33 + assumed_duration: 33, + seen_header: false } } }