From 16a25aac9d464d5e5a5d15e91d353d5af74a849b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 9 Apr 2019 00:22:19 +0200 Subject: [PATCH] libmatroska2: 0 duration frames can be keyframes The part of the Matroska specifications that claimed that Blocks from a BlockGroup with duration zero are no keyframes has been dropped in 9313a00f7391a285f95e9d6f0a5f8f3f80ed4779. This commit brings libmatroska2 in line with this change. The earlier version e.g. made mkvalidator warn about files muxed by FFmpeg that contained pgs subtitles (which are muxed as zero-duration subtitles, which is spec-compliant). Signed-off-by: Andreas Rheinhardt --- libmatroska2/matroskamain.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libmatroska2/matroskamain.c b/libmatroska2/matroskamain.c index 654ef1fa..5d283da3 100644 --- a/libmatroska2/matroskamain.c +++ b/libmatroska2/matroskamain.c @@ -698,7 +698,6 @@ uint16_t MATROSKA_BlockTrackNum(const matroska_block *Block) bool_t MATROSKA_BlockKeyframe(const matroska_block *Block) { ebml_master *BlockGroup; - ebml_integer *Duration; assert(Node_IsPartOf(Block,MATROSKA_BLOCK_CLASS)); if (Block->IsKeyframe) @@ -711,14 +710,7 @@ bool_t MATROSKA_BlockKeyframe(const matroska_block *Block) if (!BlockGroup || !Node_IsPartOf(BlockGroup,MATROSKA_BLOCKGROUP_CLASS)) return 0; - if (EBML_MasterFindChild(BlockGroup,MATROSKA_getContextReferenceBlock())) - return 0; - - Duration = (ebml_integer*)EBML_MasterFindChild(BlockGroup,MATROSKA_getContextBlockDuration()); - if (Duration!=NULL && EBML_IntegerValue(Duration)==0) - return 0; - - return 1; + return EBML_MasterFindChild(BlockGroup,MATROSKA_getContextReferenceBlock()) == NULL; } bool_t MATROSKA_BlockDiscardable(const matroska_block *Block)