summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-08-10 18:06:14 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-08-10 18:06:14 +0000
commit194d4b494b08ca7b715ca363e303e68cd75376de (patch)
tree035de973eb817da4a5de1e053d61252d69b7be71 /libavformat/matroskadec.c
parentaef6bd1bdd532dfdc8ecb45a012205953dbb13a2 (diff)
matroskadec: correctly parse flags for simpleblock frames
Originally committed as revision 19621 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c8
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;