diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-05-10 01:02:18 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-05-10 01:02:18 +0000 |
commit | 31df40a1305c7e3d4fc70513285691919e5c817b (patch) | |
tree | bcd2ddf2ae8f53b640b809f1257e24b4282a0240 /libavformat/mpegtsenc.c | |
parent | 7574dc4c37b213cebc3ab8bebdeeafa44d8df841 (diff) | |
download | ffmpeg-31df40a1305c7e3d4fc70513285691919e5c817b.tar.gz |
fix total bitrate computation, based on patch by corp186, chasedouglas at gmail dot com
Originally committed as revision 18778 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r-- | libavformat/mpegtsenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 3c34fbf116..239b035385 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -456,11 +456,11 @@ static int mpegts_write_header(AVFormatContext *s) pat_pmt_size = url_ftell(s->pb) - pos; total_bit_rate += - total_bit_rate * 25 / (8 * DEFAULT_PES_PAYLOAD_SIZE) + /* PES header size */ - total_bit_rate * 4 / (8 * TS_PACKET_SIZE) + /* TS header size */ - SDT_RETRANS_TIME * sdt_size + /* SDT size */ - PAT_RETRANS_TIME * pat_pmt_size + /* PAT+PMT size */ - PCR_RETRANS_TIME * 8; /* PCR size */ + total_bit_rate * 25 / DEFAULT_PES_PAYLOAD_SIZE + /* PES header size */ + total_bit_rate * 4 / TS_PACKET_SIZE + /* TS header size */ + SDT_RETRANS_TIME * 8 * sdt_size / 1000 + /* SDT size */ + PAT_RETRANS_TIME * 8 * pat_pmt_size / 1000 + /* PAT+PMT size */ + PCR_RETRANS_TIME * 8 * 8 / 1000; /* PCR size */ av_log(s, AV_LOG_DEBUG, "muxrate %d freq sdt %d pat %d\n", total_bit_rate, ts->sdt_packet_freq, ts->pat_packet_freq); |