Revision 3c6a9f66 libavformat/ffmenc.c

View differences:

libavformat/ffmenc.c
197 197
    AVStream *st = s->streams[pkt->stream_index];
198 198
    int64_t pts;
199 199
    uint8_t header[FRAME_HEADER_SIZE];
200
    int header_size = FRAME_HEADER_SIZE;
200 201

  
201 202
    pts = s->timestamp + pkt->pts;
202 203
    /* packet size & key_frame */
......
206 207
        header[1] |= FLAG_KEY_FRAME;
207 208
    AV_WB24(header+2, pkt->size);
208 209
    AV_WB24(header+5, pkt->duration);
209
    ffm_write_data(s, header, FRAME_HEADER_SIZE, pts, 1);
210
    AV_WB64(header+8, pts);
211
    if (pkt->pts != pkt->dts) {
212
        header[1] |= FLAG_DTS;
213
        AV_WB32(header+16, pkt->pts - pkt->dts);
214
        header_size += 4;
215
    }
216
    ffm_write_data(s, header, header_size, pts, 1);
210 217
    ffm_write_data(s, pkt->data, pkt->size, pts, 0);
211 218

  
212 219
    return 0;

Also available in: Unified diff