From: Jaroslav Kysela Date: Thu, 13 Oct 2016 15:09:53 +0000 (+0200) Subject: tsfix: allow little negative values - rounding errors? fixes #4013 X-Git-Tag: v4.2.1~269 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3cd2a5bb4286937703f258aa2be464593d1a8f1a;p=thirdparty%2Ftvheadend.git tsfix: allow little negative values - rounding errors? fixes #4013 --- diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index f1074ddab..e12f97358 100644 --- a/src/plumbing/tsfix.c +++ b/src/plumbing/tsfix.c @@ -236,8 +236,9 @@ normalize_ts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt, int backlog) return; } } else { - int64_t low = 90000; /* one second */ - int64_t upper = 2*90000; /* two seconds */ + const int64_t nlimit = -1; /* allow negative values - rounding errors? */ + int64_t low = 90000; /* one second */ + int64_t upper = 2*90000; /* two seconds */ d = dts + tfs->tfs_dts_epoch - tfs->tfs_last_dts_norm; if (tfs->tfs_subtitle) { @@ -249,7 +250,7 @@ normalize_ts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt, int backlog) upper = low - 1; } - if (d < 0 || d > low) { + if (d < nlimit || d > low) { if (d < -PTS_MASK || d > -PTS_MASK + upper) { if (pkt->pkt_err) { tsfix_packet_drop(tfs, pkt, "possible wrong discontinuity");