Commit 1685c454 authored by Thiago Santos's avatar Thiago Santos Committed by Thiago Santos

mpegtspacketizer: avoid timestamp overflows

Cause timing to break in the pipeline that can lead to a stall

https://bugzilla.gnome.org/show_bug.cgi?id=733837
parent 4c2ce9ea
......@@ -2178,8 +2178,13 @@ mpegts_packetizer_pts_to_ts (MpegTSPacketizer2 * packetizer,
*/
if (G_UNLIKELY (ABSDIFF (res, pcrtable->last_pcrtime) > 15 * GST_SECOND))
res = GST_CLOCK_TIME_NONE;
else
res += pcrtable->base_time + pcrtable->skew - pcrtable->base_pcrtime;
else {
GstClockTime tmp = pcrtable->base_time + pcrtable->skew;
if (tmp + res > pcrtable->base_pcrtime)
res += tmp - pcrtable->base_pcrtime;
else
res = GST_CLOCK_TIME_NONE;
}
} else if (packetizer->calculate_offset && pcrtable->groups) {
gint64 refpcr = G_MAXINT64, refpcroffset;
PCROffsetGroup *group = pcrtable->current->group;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment