]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tsfix: allow little negative values - rounding errors? fixes #4013
authorJaroslav Kysela <perex@perex.cz>
Thu, 13 Oct 2016 15:09:53 +0000 (17:09 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 13 Oct 2016 15:09:53 +0000 (17:09 +0200)
src/plumbing/tsfix.c

index f1074ddab6733f99c60d367cd237038f90c1ea40..e12f97358761ac39d2778d0eb7b1a2c847960612 100644 (file)
@@ -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");