From 194d4b494b08ca7b715ca363e303e68cd75376de Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Mon, 10 Aug 2009 18:06:14 +0000 Subject: matroskadec: correctly parse flags for simpleblock frames Originally committed as revision 19621 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroskadec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libavformat/matroskadec.c') 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; inb_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; -- cgit v1.2.3