]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tsfix: substitles might have large time gaps, fixes #2423
authorJaroslav Kysela <perex@perex.cz>
Sun, 26 Oct 2014 16:07:05 +0000 (17:07 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 26 Oct 2014 16:07:53 +0000 (17:07 +0100)
src/plumbing/tsfix.c

index d296d9f13e86832c09a10a8f70abc48583ac44ef..7a2572927af3d1f68f68e5948e0a16189c58e471 100644 (file)
@@ -195,11 +195,22 @@ normalize_ts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt)
       return;
     }
   } else {
+    int64_t low   =  90000; /* one second */
+    int64_t upper = 180000; /* two seconds */
     d = dts + tfs->tfs_dts_epoch - tfs->tfs_last_dts_norm;
 
-    if(d < 0 || d > 90000) {
+    if (SCT_ISSUBTITLE(tfs->tfs_type)) {
+      /*
+       * special conditions for subtitles, because they may be broadcasted
+       * with large time gaps
+       */
+      low   = PTS_MASK / 2; /* more than 13 hours */
+      upper = low - 1;
+    }
+
+    if (d < 0 || d > low) {
 
-      if(d < -PTS_MASK || d > -PTS_MASK + 180000) {
+      if(d < -PTS_MASK || d > -PTS_MASK + upper) {
 
        tfs->tfs_bad_dts++;