Revision ab4752e3 libavformat/movenc.c

View differences:

libavformat/movenc.c
44 44
#define MODE_IPOD 0x20
45 45

  
46 46
typedef struct MOVIentry {
47
    unsigned int flags, size;
47
    unsigned int size;
48 48
    uint64_t     pos;
49 49
    unsigned int samplesInChunk;
50
    char         key_frame;
51 50
    unsigned int entries;
52 51
    int          cts;
53 52
    int64_t      dts;
53
#define MOV_SYNC_SAMPLE         0x0001
54
    uint32_t     flags;
54 55
} MOVIentry;
55 56

  
56 57
typedef struct MOVIndex {
......
198 199
    entryPos = url_ftell(pb);
199 200
    put_be32(pb, track->entry); // entry count
200 201
    for (i=0; i<track->entry; i++) {
201
        if(track->cluster[i].key_frame == 1) {
202
        if (track->cluster[i].flags & MOV_SYNC_SAMPLE) {
202 203
            put_be32(pb, i+1);
203 204
            index++;
204 205
        }
......
1877 1878
    if (pkt->dts != pkt->pts)
1878 1879
        trk->hasBframes = 1;
1879 1880
    trk->cluster[trk->entry].cts = pkt->pts - pkt->dts;
1880
    trk->cluster[trk->entry].key_frame = !!(pkt->flags & PKT_FLAG_KEY);
1881
    if(trk->cluster[trk->entry].key_frame)
1881
    if (pkt->flags & PKT_FLAG_KEY) {
1882
        trk->cluster[trk->entry].flags = MOV_SYNC_SAMPLE;
1882 1883
        trk->hasKeyframes++;
1884
    }
1883 1885
    trk->entry++;
1884 1886
    trk->sampleCount += samplesInChunk;
1885 1887
    mov->mdat_size += size;

Also available in: Unified diff