1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

matroskadec: correctly parse flags for simpleblock frames

Originally committed as revision 19621 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Aurelien Jacobs 2009-08-10 18:06:14 +00:00
parent aef6bd1bdd
commit 194d4b494b
2 changed files with 10 additions and 6 deletions

View File

@ -241,6 +241,7 @@ typedef struct {
typedef struct { typedef struct {
uint64_t duration; uint64_t duration;
int64_t reference; int64_t reference;
uint64_t non_simple;
EbmlBin bin; EbmlBin bin;
} MatroskaBlock; } MatroskaBlock;
@ -479,6 +480,7 @@ static EbmlSyntax matroska_blockgroup[] = {
{ MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) }, { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) },
{ MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} }, { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} },
{ MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) }, { MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) },
{ 1, EBML_UINT, 0, offsetof(MatroskaBlock,non_simple), {.u=1} },
{ 0 } { 0 }
}; };
@ -1744,12 +1746,14 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
blocks_list = &cluster.blocks; blocks_list = &cluster.blocks;
blocks = blocks_list->elem; blocks = blocks_list->elem;
for (i=0; i<blocks_list->nb_elem; i++) 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, res=matroska_parse_block(matroska,
blocks[i].bin.data, blocks[i].bin.size, blocks[i].bin.data, blocks[i].bin.size,
blocks[i].bin.pos, cluster.timecode, blocks[i].bin.pos, cluster.timecode,
blocks[i].duration, !blocks[i].reference, blocks[i].duration, is_keyframe,
pos); pos);
}
ebml_free(matroska_cluster, &cluster); ebml_free(matroska_cluster, &cluster);
if (res < 0) matroska->done = 1; if (res < 0) matroska->done = 1;
return res; return res;

View File

@ -3029,7 +3029,7 @@ ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
ret: 0 st:-1 ts:1.894167 flags:1 ret: 0 st:-1 ts:1.894167 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1 ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
ret: 0 st: 0 ts:0.788000 flags:0 ret: 0 st: 0 ts:0.788000 flags:0
ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:252019 size:10049 flags:0 ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
ret: 0 st: 0 ts:-0.317000 flags:1 ret: 0 st: 0 ts:-0.317000 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
ret: 0 st: 1 ts:2.577000 flags:0 ret: 0 st: 1 ts:2.577000 flags:0
@ -3037,7 +3037,7 @@ ret:-32
ret: 0 st: 1 ts:1.471000 flags:1 ret: 0 st: 1 ts:1.471000 flags:1
ret: 0 st: 1 dts:1.019000 pts:1.019000 pos:320167 size:209 flags:1 ret: 0 st: 1 dts:1.019000 pts:1.019000 pos:320167 size:209 flags:1
ret: 0 st:-1 ts:0.365002 flags:0 ret: 0 st:-1 ts:0.365002 flags:0
ret: 0 st: 0 dts:0.400000 pts:0.400000 pos:127917 size:8765 flags:0 ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146679 size:27925 flags:1
ret: 0 st:-1 ts:-0.740831 flags:1 ret: 0 st:-1 ts:-0.740831 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
ret: 0 st: 0 ts:2.153000 flags:0 ret: 0 st: 0 ts:2.153000 flags:0
@ -3051,7 +3051,7 @@ ret: 0 st: 1 dts:1.019000 pts:1.019000 pos:320167 size:209 flags:1
ret: 0 st:-1 ts:1.730004 flags:0 ret: 0 st:-1 ts:1.730004 flags:0
ret:-32 ret:-32
ret: 0 st:-1 ts:0.624171 flags:1 ret: 0 st:-1 ts:0.624171 flags:1
ret: 0 st: 0 dts:0.600000 pts:0.600000 pos:198672 size:10122 flags:0 ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146679 size:27925 flags:1
ret: 0 st: 0 ts:-0.482000 flags:0 ret: 0 st: 0 ts:-0.482000 flags:0
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
ret: 0 st: 0 ts:2.413000 flags:1 ret: 0 st: 0 ts:2.413000 flags:1
@ -3065,7 +3065,7 @@ ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
ret: 0 st:-1 ts:1.989173 flags:1 ret: 0 st:-1 ts:1.989173 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1 ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
ret: 0 st: 0 ts:0.883000 flags:0 ret: 0 st: 0 ts:0.883000 flags:0
ret: 0 st: 0 dts:0.920000 pts:0.920000 pos:281319 size:10351 flags:0 ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
ret: 0 st: 0 ts:-0.222000 flags:1 ret: 0 st: 0 ts:-0.222000 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
ret: 0 st: 1 ts:2.672000 flags:0 ret: 0 st: 1 ts:2.672000 flags:0