changeset 4912:f718560a7763 libavformat

fix total bitrate computation, based on patch by corp186, chasedouglas at gmail dot com
author bcoudurier
date Sun, 10 May 2009 01:02:18 +0000
parents 42098ccb51ab
children 5d22e1946275
files mpegtsenc.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mpegtsenc.c	Wed May 06 23:02:26 2009 +0000
+++ b/mpegtsenc.c	Sun May 10 01:02:18 2009 +0000
@@ -456,11 +456,11 @@
     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);