diff options
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 9405b46c70..068fcc17c3 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -241,6 +241,7 @@ typedef struct { typedef struct { uint64_t duration; int64_t reference; + uint64_t non_simple; EbmlBin bin; } MatroskaBlock; @@ -479,6 +480,7 @@ static EbmlSyntax matroska_blockgroup[] = { { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) }, { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} }, { MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) }, + { 1, EBML_UINT, 0, offsetof(MatroskaBlock,non_simple), {.u=1} }, { 0 } }; @@ -1744,12 +1746,14 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska) blocks_list = &cluster.blocks; blocks = blocks_list->elem; for (i=0; i<blocks_list->nb_elem; i++) - if (blocks[i].bin.size > 0) + if (blocks[i].bin.size > 0) { + int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1; res=matroska_parse_block(matroska, blocks[i].bin.data, blocks[i].bin.size, blocks[i].bin.pos, cluster.timecode, - blocks[i].duration, !blocks[i].reference, + blocks[i].duration, is_keyframe, pos); + } ebml_free(matroska_cluster, &cluster); if (res < 0) matroska->done = 1; return res; |