mpegtsdemux: Fix off by one error

Turns out timestamps of zero are valid :) Fixes issues with streams where the
PTS/DTS would be equal to the first PCR.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1807>
This commit is contained in:
Edward Hervey 2020-11-13 17:50:03 +01:00 committed by Edward Hervey
parent f9a0efe3ed
commit 50e230a270

View file

@ -2268,7 +2268,7 @@ mpegts_packetizer_pts_to_ts (MpegTSPacketizer2 * packetizer,
res = GST_CLOCK_TIME_NONE;
else {
GstClockTime tmp = pcrtable->base_time + pcrtable->skew;
if (tmp + res > pcrtable->base_pcrtime)
if (tmp + res >= pcrtable->base_pcrtime)
res += tmp - pcrtable->base_pcrtime;
else
res = GST_CLOCK_TIME_NONE;