[FFmpeg-devel] [PATCHed] change PAT/PMT/SDT playout to be dependant on PTS and not a number of packets.

JULIAN GARDNER joolzg at btinternet.com
Wed May 18 20:52:08 CEST 2011




>________________________________
>From: Michael Niedermayer <michaelni at gmx.at>
>To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
>Sent: Wednesday, 18 May 2011, 20:31
>Subject: Re: [FFmpeg-devel] [PATCH] change PAT/PMT/SDT playout to be dependant on PTS and not a number of packets.
>
>On Wed, May 18, 2011 at 02:21:03PM +0100, JULIAN GARDNER wrote:
>> Change the way in which the PAT, PMT and SDT are inserted into the Mpeg TS, now dependant on time.
>> 
>> Set to repeat at
>> 
>> PAT     250ms
>> PMT     375ms
>> SDT     1250ms
>> 
>> Maybe add a way of the user setting these values to give faster or slower playout rates, as this does add to the TS overhead.
>>
>
>
>> Also cleaned up the udp.c, removed some variables and an av_log
>
>ive applied the changes to udp.c
>
>
>[...]
>> @@ -594,21 +611,31 @@ static int mpegts_write_header(AVFormatContext *s)
>>  }
>>  
>>  /* send SDT, PAT and PMT tables regulary */
>> -static void retransmit_si_info(AVFormatContext *s)
>> +static void retransmit_si_info(AVFormatContext *s, int64_t pts)    // MpegTSWriteStream *ts_st)
>>  {
>>      MpegTSWrite *ts = s->priv_data;
>>      int i;
>> +    int64_t temp_pts;
>>  
>> -    if (++ts->sdt_packet_count == ts->sdt_packet_period) {
>> -        ts->sdt_packet_count = 0;
>> +    temp_pts = 90*SDT_RETRANS_TIME;
>> +    if (ts->sdt_pts==-1 || (abs(ts->sdt_pts-pts)>temp_pts)) {
>>          mpegts_write_sdt(s);
>
>> +//    av_log( s, AV_LOG_INFO, "SDT %llx\r\n", pts); // ts_st->payload_pts);
>> +        ts->sdt_pts = pts;
>
>tabs are not allowed in git
>
>
>[...]
>> @@ -636,15 +663,14 @@ static uint8_t* write_pcr_bits(uint8_t *buf, int64_t pcr)
>>  static void mpegts_insert_null_packet(AVFormatContext *s)
>>  {
>>      uint8_t *q;
>> -    uint8_t buf[TS_PACKET_SIZE];
>>  
>> -    q = buf;
>> +    q = ts_buf;
>>      *q++ = 0x47;
>>      *q++ = 0x00 | 0x1f;
>>      *q++ = 0xff;
>>      *q++ = 0x10;
>
>this breaks multithreadad applications
>
>[...]
>-- 
>Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
>Republics decline into democracies and democracies degenerate into
>despotisms. -- Aristotle
>
>_______________________________________________
>ffmpeg-devel mailing list
>ffmpeg-devel at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
>

Fixed tabs, hope i got them all

fixed ts buffer, now back local


joolz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpegenc.diff
Type: application/octet-stream
Size: 4746 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110518/53661d8a/attachment.obj>


More information about the ffmpeg-devel mailing list