From e0346ae30a1f412b9ebac78afe8bab91aa912b06 Mon Sep 17 00:00:00 2001 From: Tangent 128 Date: Wed, 4 Oct 2017 02:10:58 -0400 Subject: [PATCH] leave mark-keyframes reminder in webm chunker --- src/chunk.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chunk.rs b/src/chunk.rs index b8ce3f2..f85c1f0 100644 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -133,6 +133,10 @@ impl<'a, S: Stream>> Stream for WebmChunker continue; }, Ok(Async::Ready(Some(WebmElement::SimpleBlock(ref block)))) => { + if (block.flags & 0b10000000) != 0 { + // TODO: this is incorrect, condition needs to also affirm we're the first video block of the cluster + cluster_head.mark_keyframe(true); + } cluster_head.observe_simpleblock_timecode(block.timecode); encode_webm_element(&WebmElement::SimpleBlock(*block), buffer); continue;