[FFmpeg-soc] [soc]: r3939 - dvbmuxer/mpegtsenc.c

bcoudurier subversion at mplayerhq.hu
Sat Jan 10 02:59:03 CET 2009


Author: bcoudurier
Date: Sat Jan 10 02:59:02 2009
New Revision: 3939

Log:
use correct timebase in pcr computation

Modified:
   dvbmuxer/mpegtsenc.c

Modified: dvbmuxer/mpegtsenc.c
==============================================================================
--- dvbmuxer/mpegtsenc.c	Sat Jan 10 02:08:41 2009	(r3938)
+++ dvbmuxer/mpegtsenc.c	Sat Jan 10 02:59:02 2009	(r3939)
@@ -25,6 +25,9 @@
 #include "libavcodec/bytestream.h"
 #include "mpegpes.h"
 
+#define PCR_TIME_BASE 27000000LL
+#define MAX_DELTA_PCR (PCR_TIME_BASE / 25) /**< 40ms for DVB */
+
 /* write DVB SI sections */
 
 /*********************************************/
@@ -106,7 +109,7 @@ static void mpegts_write_section(MpegTSS
 
         buf_ptr += len1;
         len -= len1;
-        ts->cur_pcr += TS_PACKET_SIZE*8*90000LL/ts->mux_rate;
+        ts->cur_pcr += TS_PACKET_SIZE*8*PCR_TIME_BASE/ts->mux_rate;
     }
 }
 
@@ -165,9 +168,6 @@ static int mpegts_write_section1(MpegTSS
 #define SDT_RETRANS_TIME 500
 #define PAT_RETRANS_TIME 100
 
-#define PCR_TIME_BASE 27000000LL
-#define MAX_DELTA_PCR (PCR_TIME_BASE / 25) /**< 40ms for DVB */
-
 typedef struct MpegTSWriteStream {
     StreamInfo pes;
     struct MpegTSService *service;
@@ -516,7 +516,6 @@ static void mpegts_write_pes(AVFormatCon
     int afc_len, stuffing_len;
 
     is_start = 1;
-    ts->cur_pcr = pcr;
     while (payload_size > 0) {
         retransmit_si_info(s);
 
@@ -587,7 +586,7 @@ static void mpegts_write_pes(AVFormatCon
         payload += len;
         payload_size -= len;
         put_buffer(s->pb, buf, TS_PACKET_SIZE);
-        ts->cur_pcr += TS_PACKET_SIZE*8*90000LL/ts->mux_rate;
+        ts->cur_pcr += TS_PACKET_SIZE*8*PCR_TIME_BASE/ts->mux_rate;
     }
     put_flush_packet(s->pb);
 }



More information about the FFmpeg-soc mailing list