From d49422a89912263f844a21197341a5dca5d04259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Fri, 19 Oct 2012 09:54:50 +0200 Subject: [PATCH] tsfix: Mask timestamps with PTS_MASK When debugging the tsfix code a developer can now narrow PTS_MASK to force wrap to happen much more frequently --- src/plumbing/tsfix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index d04e610d..dfab483c 100644 --- a/src/plumbing/tsfix.c +++ b/src/plumbing/tsfix.c @@ -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); }