]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tsfix: Mask timestamps with PTS_MASK
authorAndreas Öman <andreas@lonelycoder.com>
Fri, 19 Oct 2012 07:54:50 +0000 (09:54 +0200)
committerAndreas Öman <andreas@lonelycoder.com>
Thu, 25 Oct 2012 11:06:04 +0000 (13:06 +0200)
When debugging the tsfix code a developer can now narrow PTS_MASK
to force wrap to happen much more frequently

src/plumbing/tsfix.c

index d04e610db1f33de71cd6709eceddc167fc862b35..dfab483c5f304f856162fbe9d892b9825c64816f 100644 (file)
@@ -153,6 +153,9 @@ normalize_ts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt)
     return;
   }
 
+  pkt->pkt_dts &= PTS_MASK;
+  pkt->pkt_pts &= PTS_MASK;
+
   /* Subtract the transport wide start offset */
   dts = pkt->pkt_dts - tf->tf_tsref;
 
@@ -315,7 +318,7 @@ tsfix_input_packet(tsfix_t *tf, streaming_message_t *sm)
   if(tf->tf_tsref == PTS_UNSET &&
      (!tf->tf_hasvideo ||
       (SCT_ISVIDEO(tfs->tfs_type) && pkt->pkt_frametype == PKT_I_FRAME))) {
-      tf->tf_tsref = pkt->pkt_dts;
+      tf->tf_tsref = pkt->pkt_dts & PTS_MASK;
       tsfixprintf("reference clock set to %"PRId64"\n", tf->tf_tsref);
   }