mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-15 04:24:18 +00:00
mpegtspacketizer: handle early PTS conversion when a group has been found
In some cases, the PTS might be smaller than the first observed PCR value which causes element to apply wraparound leading to bogus timestamp. To solve this, we only apply it if the PTS-PCR difference is greater that 1 second to be sure that it's a real wraparound. Moreover, using unsigned 32 bits values to handle wrapover could end up with bogus value, so it use pts value to handle it. Also, convert pcr time to gst time before comparing it to pts. Since refpcr is expressed in PCR time base while pts is expressed in GStreamer time. https://bugzilla.gnome.org/show_bug.cgi?id=743259
This commit is contained in:
parent
c22a8a6224
commit
d87177b69b
1 changed files with 6 additions and 2 deletions
|
@ -2283,8 +2283,12 @@ mpegts_packetizer_pts_to_ts (MpegTSPacketizer2 * packetizer,
|
|||
GST_DEBUG ("Using group !");
|
||||
refpcr = group->first_pcr;
|
||||
refpcroffset = group->pcr_offset;
|
||||
if (pts < refpcr)
|
||||
refpcr -= PCR_MAX_VALUE;
|
||||
if (pts < PCRTIME_TO_GSTTIME (refpcr)) {
|
||||
if (PCRTIME_TO_GSTTIME (refpcr) - pts > GST_SECOND)
|
||||
pts += PCR_GST_MAX_VALUE;
|
||||
else
|
||||
refpcr = G_MAXINT64;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (refpcr != G_MAXINT64)
|
||||
|
|
Loading…
Reference in a new issue