From 0772a5ac99e5769b58f2982a66d3ea1cd70aaa34 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 3 Nov 2017 15:11:04 +0100 Subject: [PATCH] tsfix: show also the reason in the trace log --- src/plumbing/tsfix.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index 67a328cc3..aa83b54b6 100644 --- a/src/plumbing/tsfix.c +++ b/src/plumbing/tsfix.c @@ -195,7 +195,11 @@ tsfix_stop(tsfix_t *tf) static void tsfix_packet_drop(tfstream_t *tfs, th_pkt_t *pkt, const char *reason) { - pkt_trace(LS_TSFIX, pkt, "drop"); + if (tvhtrace_enabled()) { + char buf[64]; + snprintf(buf, sizeof(buf), "drop %s", reason); + pkt_trace(LS_TSFIX, pkt, buf); + } pkt_ref_dec(pkt); } @@ -539,14 +543,17 @@ compute_pts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt) static void tsfix_input_packet(tsfix_t *tf, streaming_message_t *sm) { - th_pkt_t *pkt = pkt_copy_shallow(sm->sm_data); - tfstream_t *tfs = tfs_find(tf, pkt), *tfs2; - streaming_msg_free(sm); + th_pkt_t *pkt; + tfstream_t *tfs, *tfs2; int64_t diff, diff2, threshold; int r; + pkt = pkt_copy_shallow(sm->sm_data); + tfs = tfs_find(tf, pkt); + streaming_msg_free(sm); + if (tfs == NULL || mclk() < tf->tf_start_time) { - pkt_ref_dec(pkt); + tsfix_packet_drop(tfs, pkt, "start time"); return; } -- 2.47.3