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 } } }