fix ts packet header size computation, patch by Niobos, niobos at dest-unreach dot be
authorNiobos <niobos@dest-unreach.be>
Wed, 13 Jan 2010 20:20:05 +0000 (20:20 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Wed, 13 Jan 2010 20:20:05 +0000 (20:20 +0000)
Originally committed as revision 21196 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mpegtsenc.c

index 029d894..e283068 100644 (file)
@@ -472,7 +472,7 @@ static int mpegts_write_header(AVFormatContext *s)
     pat_pmt_size = url_ftell(s->pb) - pos;
 
     total_bit_rate +=
-        total_bit_rate *  4 / TS_PACKET_SIZE           + /* TS  header size */
+        total_bit_rate * 4 / (TS_PACKET_SIZE-4)        + /* TS header size */
         1000 * 8 * sdt_size     / PAT_RETRANS_TIME     + /* SDT size */
         1000 * 8 * pat_pmt_size / SDT_RETRANS_TIME     + /* PAT+PMT size */
         1000 * 8 * 8            / PCR_RETRANS_TIME;      /* PCR size */