mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
mpegtspacketizer: Handle early PTS conversion
When handling the PTS/DTS conversion in new groups, there's a possibility that the PTS might be smaller than the first PCR value observed, due to re-ordering. When using the current group, only apply the wraparound correction when we are certain it is one (i.e. differs by more than a second) and not when it's just a small difference (like out-of-order PTS). https://bugzilla.gnome.org/show_bug.cgi?id=731088
This commit is contained in:
parent
c60f4ecd11
commit
a822517ca9
1 changed files with 10 additions and 2 deletions
|
@ -2151,8 +2151,16 @@ mpegts_packetizer_pts_to_ts (MpegTSPacketizer2 * packetizer,
|
|||
GST_TIME_ARGS (PCRTIME_TO_GSTTIME (group->pcr_offset)));
|
||||
refpcr = group->first_pcr;
|
||||
refpcroffset = group->pcr_offset;
|
||||
if (pts < PCRTIME_TO_GSTTIME (refpcr))
|
||||
refpcr -= PCR_MAX_VALUE;
|
||||
if (pts < PCRTIME_TO_GSTTIME (refpcr)) {
|
||||
/* Only apply wrapover if we're certain it is, and avoid
|
||||
* returning bogus values if it's a PTS/DTS which is *just*
|
||||
* before the start of the current group
|
||||
*/
|
||||
if (ABSDIFF (pts, PCRTIME_TO_GSTTIME (refpcr)) > GST_SECOND)
|
||||
refpcr -= PCR_MAX_VALUE;
|
||||
else
|
||||
refpcr = G_MAXINT64;
|
||||
}
|
||||
} else {
|
||||
GList *tmp;
|
||||
/* Otherwise, find a suitable group */
|
||||
|
|
Loading…
Reference in a new issue