Revision 194d4b49

View differences:

libavformat/matroskadec.c
241 241
typedef struct {
242 242
    uint64_t duration;
243 243
    int64_t  reference;
244
    uint64_t non_simple;
244 245
    EbmlBin  bin;
245 246
} MatroskaBlock;
246 247

  
......
479 480
    { MATROSKA_ID_SIMPLEBLOCK,    EBML_BIN,  0, offsetof(MatroskaBlock,bin) },
480 481
    { MATROSKA_ID_BLOCKDURATION,  EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} },
481 482
    { MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) },
483
    { 1,                          EBML_UINT, 0, offsetof(MatroskaBlock,non_simple), {.u=1} },
482 484
    { 0 }
483 485
};
484 486

  
......
1744 1746
    blocks_list = &cluster.blocks;
1745 1747
    blocks = blocks_list->elem;
1746 1748
    for (i=0; i<blocks_list->nb_elem; i++)
1747
        if (blocks[i].bin.size > 0)
1749
        if (blocks[i].bin.size > 0) {
1750
            int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
1748 1751
            res=matroska_parse_block(matroska,
1749 1752
                                     blocks[i].bin.data, blocks[i].bin.size,
1750 1753
                                     blocks[i].bin.pos,  cluster.timecode,
1751
                                     blocks[i].duration, !blocks[i].reference,
1754
                                     blocks[i].duration, is_keyframe,
1752 1755
                                     pos);
1756
        }
1753 1757
    ebml_free(matroska_cluster, &cluster);
1754 1758
    if (res < 0)  matroska->done = 1;
1755 1759
    return res;
tests/seek.regression.ref
3029 3029
ret: 0 st:-1 ts:1.894167 flags:1
3030 3030
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
3031 3031
ret: 0 st: 0 ts:0.788000 flags:0
3032
ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:252019 size:10049 flags:0
3032
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
3033 3033
ret: 0 st: 0 ts:-0.317000 flags:1
3034 3034
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
3035 3035
ret: 0 st: 1 ts:2.577000 flags:0
......
3037 3037
ret: 0 st: 1 ts:1.471000 flags:1
3038 3038
ret: 0 st: 1 dts:1.019000 pts:1.019000 pos:320167 size:209 flags:1
3039 3039
ret: 0 st:-1 ts:0.365002 flags:0
3040
ret: 0 st: 0 dts:0.400000 pts:0.400000 pos:127917 size:8765 flags:0
3040
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146679 size:27925 flags:1
3041 3041
ret: 0 st:-1 ts:-0.740831 flags:1
3042 3042
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
3043 3043
ret: 0 st: 0 ts:2.153000 flags:0
......
3051 3051
ret: 0 st:-1 ts:1.730004 flags:0
3052 3052
ret:-32
3053 3053
ret: 0 st:-1 ts:0.624171 flags:1
3054
ret: 0 st: 0 dts:0.600000 pts:0.600000 pos:198672 size:10122 flags:0
3054
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146679 size:27925 flags:1
3055 3055
ret: 0 st: 0 ts:-0.482000 flags:0
3056 3056
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
3057 3057
ret: 0 st: 0 ts:2.413000 flags:1
......
3065 3065
ret: 0 st:-1 ts:1.989173 flags:1
3066 3066
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
3067 3067
ret: 0 st: 0 ts:0.883000 flags:0
3068
ret: 0 st: 0 dts:0.920000 pts:0.920000 pos:281319 size:10351 flags:0
3068
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
3069 3069
ret: 0 st: 0 ts:-0.222000 flags:1
3070 3070
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
3071 3071
ret: 0 st: 1 ts:2.672000 flags:0

Also available in: Unified diff