]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Revert "Implement recovery mechanism instead of dropping packets on PTS_UNSET"
authorFlole <Flole998@users.noreply.github.com>
Tue, 13 Jan 2026 19:16:16 +0000 (20:16 +0100)
committerFlole <Flole998@users.noreply.github.com>
Tue, 13 Jan 2026 23:09:11 +0000 (00:09 +0100)
This reverts commit 00565cf302993d18ece15f6f2f77e5d87e1a5c35.

src/plumbing/tsfix.c

index e6cf1b2a1bc3338ee28f28f68155f0699305ec37..d5db580d4329c9e2c537c53a39396a0f70477526 100644 (file)
@@ -242,32 +242,10 @@ normalize_ts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt, int backlog)
   else
     dts = pts_diff(ref, pkt->pkt_dts);
 
-  /* Handle case where pts_diff returns PTS_UNSET due to inconsistent timestamps */
+  /* Check for invalid DTS calculation result */
   if (dts == PTS_UNSET) {
-    tvhtrace(LS_TSFIX, "%s: DTS calculation failed, attempting recovery (ref=%"PRId64" pkt_dts=%"PRId64")",
-             streaming_component_type2txt(tfs->tfs_type), ref, pkt->pkt_dts);
-    
-    /* Try to re-establish reference using current packet DTS */
-    if (tfs->tfs_local_ref == PTS_UNSET) {
-      tfs->tfs_local_ref = pkt->pkt_dts & PTS_MASK;
-      tvhtrace(LS_TSFIX, "%s: Re-established local reference to %"PRId64,
-               streaming_component_type2txt(tfs->tfs_type), tfs->tfs_local_ref);
-      /* Recalculate with new reference */
-      if (tf->dts_offset_apply)
-        dts = pts_diff(tfs->tfs_local_ref, pkt->pkt_dts + tf->dts_offset);
-      else
-        dts = pts_diff(tfs->tfs_local_ref, pkt->pkt_dts);
-    }
-    
-    /* If still failing, this might be a timestamp rollover case */
-    if (dts == PTS_UNSET) {
-      /* Reset normalization state to handle potential rollover */
-      tfs->tfs_last_dts_norm = PTS_UNSET;
-      tfs->tfs_dts_epoch = 0;
-      dts = 0; /* Start from zero for this stream */
-      tvhtrace(LS_TSFIX, "%s: Reset normalization state due to timestamp inconsistency",
-               streaming_component_type2txt(tfs->tfs_type));
-    }
+    tsfix_packet_drop(tfs, pkt, "invalid dts calculation");
+    return;
   }
 
   if (tfs->tfs_last_dts_norm == PTS_UNSET) {