On Sun, Nov 30, 2014 at 11:01 AM, Luca Barbato <[email protected]> wrote: > On 29/11/14 17:53, Vittorio Giovara wrote: >> >> From: Fredrik Axelsson <[email protected]> >> >> Signed-off-by: Fredrik Axelsson <[email protected]> >> Signed-off-by: Michael Niedermayer <[email protected]> >> --- >> libavformat/mpegtsenc.c | 42 +++++++++++++++++++++++++++++++++++------- >> 1 file changed, 35 insertions(+), 7 deletions(-) >> >> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c >> index 1082650..e68c74c 100644 >> --- a/libavformat/mpegtsenc.c >> +++ b/libavformat/mpegtsenc.c >> @@ -78,6 +78,7 @@ typedef struct MpegTSWrite { >> >> int pmt_start_pid; >> int start_pid; >> + int m2ts_mode; >> >> int reemit_pat_pmt; // backward compatibility >> >> @@ -465,9 +466,28 @@ static MpegTSService *mpegts_add_service(MpegTSWrite >> *ts, int sid, >> return service; >> } >> >> +static int64_t get_pcr(const MpegTSWrite *ts, AVIOContext *pb) >> +{ >> + return av_rescale(avio_tell(pb) + 11, 8 * PCR_TIME_BASE, >> ts->mux_rate) + >> + ts->first_pcr; >> +} >> + >> +static void mpegts_prefix_m2ts_header(AVFormatContext *s) >> +{ >> + MpegTSWrite *ts = s->priv_data; >> + if (ts->m2ts_mode) { >> + int64_t pcr = get_pcr(s->priv_data, s->pb); >> + uint32_t tp_extra_header = pcr % 0x3fffffff; > > > Do not we have a name for ^^^^
Does not look like it, I only found libavformat/oggparsedirac.c: uint64_t pframe = gp & 0x3fffffff; in our codebase. Do you want me to do something about it? -- Vittorio _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
