Revision 148c8d80

View differences:

libavformat/ffmenc.c
188 188

  
189 189
static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
190 190
{
191
    int64_t pts;
191
    int64_t dts;
192 192
    uint8_t header[FRAME_HEADER_SIZE];
193 193
    int header_size = FRAME_HEADER_SIZE;
194 194

  
195
    pts = s->timestamp + pkt->pts;
195
    dts = s->timestamp + pkt->dts;
196 196
    /* packet size & key_frame */
197 197
    header[0] = pkt->stream_index;
198 198
    header[1] = 0;
......
200 200
        header[1] |= FLAG_KEY_FRAME;
201 201
    AV_WB24(header+2, pkt->size);
202 202
    AV_WB24(header+5, pkt->duration);
203
    AV_WB64(header+8, pts);
203
    AV_WB64(header+8, s->timestamp + pkt->pts);
204 204
    if (pkt->pts != pkt->dts) {
205 205
        header[1] |= FLAG_DTS;
206 206
        AV_WB32(header+16, pkt->pts - pkt->dts);
207 207
        header_size += 4;
208 208
    }
209
    ffm_write_data(s, header, header_size, pts, 1);
210
    ffm_write_data(s, pkt->data, pkt->size, pts, 0);
209
    ffm_write_data(s, header, header_size, dts, 1);
210
    ffm_write_data(s, pkt->data, pkt->size, dts, 0);
211 211

  
212 212
    return 0;
213 213
}
tests/libav.regression.ref
15 15
d6fdeb9f7083cc827f9510c6c4517dc0 *./tests/data/b-libav.swf
16 16
335771 ./tests/data/b-libav.swf
17 17
./tests/data/b-libav.swf CRC=0xe14e8847
18
11eec620bdcd3ef1a053fdb964d1b855 *./tests/data/b-libav.ffm
18
3dbacdc3fccb551f8ab54c32f648e7a8 *./tests/data/b-libav.ffm
19 19
380928 ./tests/data/b-libav.ffm
20 20
./tests/data/b-libav.ffm CRC=0x2b71a386
21 21
f8ad5bd78f4d012a8ce9570aa395ac54 *./tests/data/b-libav.flv

Also available in: Unified diff