diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-22 08:50:57 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-22 08:50:57 +0000 |
commit | 148c8d80180cfcc9115c6fae87401f50ecc4b987 (patch) | |
tree | 915a4a4561a70a3ddb67ec954fc457d8b1306631 /libavformat | |
parent | 5e5f75cf8abd76ada3011790a9b4f0762a72e41a (diff) | |
download | ffmpeg-148c8d80180cfcc9115c6fae87401f50ecc4b987.tar.gz |
store dts in ffm headers
Originally committed as revision 13880 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/ffmenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index 5747e855a5..630df4cd47 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -188,11 +188,11 @@ static int ffm_write_header(AVFormatContext *s) static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) { - int64_t pts; + int64_t dts; uint8_t header[FRAME_HEADER_SIZE]; int header_size = FRAME_HEADER_SIZE; - pts = s->timestamp + pkt->pts; + dts = s->timestamp + pkt->dts; /* packet size & key_frame */ header[0] = pkt->stream_index; header[1] = 0; @@ -200,14 +200,14 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) header[1] |= FLAG_KEY_FRAME; AV_WB24(header+2, pkt->size); AV_WB24(header+5, pkt->duration); - AV_WB64(header+8, pts); + AV_WB64(header+8, s->timestamp + pkt->pts); if (pkt->pts != pkt->dts) { header[1] |= FLAG_DTS; AV_WB32(header+16, pkt->pts - pkt->dts); header_size += 4; } - ffm_write_data(s, header, header_size, pts, 1); - ffm_write_data(s, pkt->data, pkt->size, pts, 0); + ffm_write_data(s, header, header_size, dts, 1); + ffm_write_data(s, pkt->data, pkt->size, dts, 0); return 0; } |