diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-09 07:43:14 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-09 07:43:14 +0000 |
commit | 3c6a9f66b9b46a158ce6ddb74637f8298d7ab4da (patch) | |
tree | ead6d4ee57dcb3c85722f7e6d4ddc59b9262b7b8 /libavformat/ffmenc.c | |
parent | 8983aa337c5f09ef858e1ab73c38b47f1dedd7b0 (diff) | |
download | ffmpeg-3c6a9f66b9b46a158ce6ddb74637f8298d7ab4da.tar.gz |
pass dts and pts through ffm, should fix streaming b frames
Originally committed as revision 13725 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/ffmenc.c')
-rw-r--r-- | libavformat/ffmenc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index 738d3101da..70306b1f5a 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -197,6 +197,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) AVStream *st = s->streams[pkt->stream_index]; int64_t pts; uint8_t header[FRAME_HEADER_SIZE]; + int header_size = FRAME_HEADER_SIZE; pts = s->timestamp + pkt->pts; /* packet size & key_frame */ @@ -206,7 +207,13 @@ 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); - ffm_write_data(s, header, FRAME_HEADER_SIZE, pts, 1); + AV_WB64(header+8, 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); return 0; |