On Sun, 5 Apr 2015, Derek Buitenhuis wrote:
Signed-off-by: Derek Buitenhuis <[email protected]> --- libavformat/mpegtsenc.c | 10 +++++++--- libavformat/version.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-)diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 2340e34..5635a8e 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -85,6 +85,7 @@ typedef struct MpegTSWrite { int pcr_period; int sdt_period; + int pat_period; #define MPEGTS_FLAG_REEMIT_PAT_PMT 0x01 #define MPEGTS_FLAG_AAC_LATM 0x02 int flags; @@ -191,7 +192,7 @@ static int mpegts_write_section1(MpegTSSection *s, int tid, int id, /* we retransmit the SI info at this rate */ #define SDT_RETRANS_TIME 200 -#define PAT_RETRANS_TIME 100 +#define PAT_RETRANS_TIME 40 #define PCR_RETRANS_TIME 20 typedef struct MpegTSWriteStream { @@ -648,14 +649,14 @@ static int mpegts_write_header(AVFormatContext *s) (TS_PACKET_SIZE * 8 * 1000); ts->sdt_packet_period = (ts->mux_rate * ts->sdt_period) / (TS_PACKET_SIZE * 8 * 1000); - ts->pat_packet_period = (ts->mux_rate * PAT_RETRANS_TIME) / + ts->pat_packet_period = (ts->mux_rate * ts->pat_period) / (TS_PACKET_SIZE * 8 * 1000); ts->first_pcr = av_rescale(s->max_delay, PCR_TIME_BASE, AV_TIME_BASE); } else { /* Arbitrary values, PAT/PMT could be written on key frames */ ts->sdt_packet_period = ts->sdt_period; - ts->pat_packet_period = 40; + ts->pat_packet_period = ts->pat_period; if (pcr_st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (!pcr_st->codec->frame_size) { av_log(s, AV_LOG_WARNING, "frame size not set\n");
Same comment as for 1/3, this changes the default for the CBR case, and is icky when one single value is interpreted differently in two completely different units.
// Martin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
