On Fri, Mar 25, 2016 at 12:50:29PM -0400, Predrag Filipovic wrote: > Enable proper PCR insertion for VBR multiplexing (muxrate not specified). > Insertion timing is based on video frame keys and frame period, consequently > pcr period precision is limited to +/- one video frame period. > > Signed-off-by: Predrag Filipovic <agoracs...@gmail.com> > --- > libavformat/mpegtsenc.c | 80 > +++++++++++++++++++++++++++++++++++++------------ > 1 file changed, 61 insertions(+), 19 deletions(-) > > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c > index 7656720..7ed9076 100644 > --- a/libavformat/mpegtsenc.c > +++ b/libavformat/mpegtsenc.c > @@ -105,6 +105,7 @@ typedef struct MpegTSWrite { > int tables_version; > double pat_period; > double sdt_period; > + int64_t last_pcr_ts; > int64_t last_pat_ts; > int64_t last_sdt_ts; > > @@ -903,6 +904,9 @@ static int mpegts_init(AVFormatContext *s) > ts_st = pcr_st->priv_data; > > if (ts->mux_rate > 1) { > + if (ts->pcr_period >= INT_MAX/2) { > + ts->pcr_period = PCR_RETRANS_TIME; > + } > service->pcr_packet_period = (int64_t)ts->mux_rate * ts->pcr_period / > (TS_PACKET_SIZE * 8 * 1000); > ts->sdt_packet_period = (int64_t)ts->mux_rate * > SDT_RETRANS_TIME / > @@ -931,10 +935,19 @@ static int mpegts_init(AVFormatContext *s) > service->pcr_packet_period = > ts_st->user_tb.den / (10 * ts_st->user_tb.num); > } > - if (!service->pcr_packet_period) > + /* if pcr_period specified, mark pcr_packet_period as NA (=INT_MAX) > */ > + if (ts->pcr_period < INT_MAX/2) { > + service->pcr_packet_period = INT_MAX; > + } else { > + if (!service->pcr_packet_period) { > service->pcr_packet_period = 1; > + } else if (service->pcr_packet_period == INT_MAX) { > + service->pcr_packet_period--; > + } > + }
there is somethig wrong with the indention here have you tested the patch with multiple programs ? what have you used to test that the TS after this patch is more valid than before ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already.
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel