summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorThiago Santos <ts.santos@osg.sisa.samsung.com>2014-07-29 02:11:54 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2014-08-01 10:37:15 -0300
commit1685c454653211a734f6a5a018c5ae0de686bbd1 (patch)
treec5066cd7de6aff53acab2f527f41257e03f9eb3b /gst
parent4c2ce9eac716afec3b6b486742e1a5c8dd9e0fdb (diff)
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
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegtsdemux/mpegtspacketizer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c
index 7889c7e60..60cb9a2fe 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.c
+++ b/gst/mpegtsdemux/mpegtspacketizer.c
@@ -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;