From: Jaroslav Kysela Date: Sat, 13 Aug 2016 10:22:49 +0000 (+0200) Subject: tsfix: don't set reference clocks when packet is incomplete (with error) X-Git-Tag: v4.2.1~387 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc51bbae0a184195b60b1b7a081dba6192480395;p=thirdparty%2Ftvheadend.git tsfix: don't set reference clocks when packet is incomplete (with error) --- diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index 991cc79cd..d4380966f 100644 --- a/src/plumbing/tsfix.c +++ b/src/plumbing/tsfix.c @@ -454,6 +454,10 @@ tsfix_input_packet(tsfix_t *tf, streaming_message_t *sm) if(pkt->pkt_dts != PTS_UNSET && tf->tf_tsref == PTS_UNSET && ((!tf->tf_hasvideo && tfs->tfs_audio) || (tfs->tfs_video && pkt->pkt_frametype == PKT_I_FRAME))) { + if (pkt->pkt_err) { + tsfix_packet_drop(tfs, pkt, "ref1"); + return; + } threshold = 22500; LIST_FOREACH(tfs2, &tf->tf_streams, tfs_link) if (tfs != tfs2 && (tfs2->tfs_audio || tfs2->tfs_video) && !tfs2->tfs_seen) { @@ -471,6 +475,10 @@ tsfix_input_packet(tsfix_t *tf, streaming_message_t *sm) } } else if (tfs->tfs_local_ref == PTS_UNSET && tf->tf_tsref != PTS_UNSET && pkt->pkt_dts != PTS_UNSET) { + if (pkt->pkt_err) { + tsfix_packet_drop(tfs, pkt, "ref2"); + return; + } if (tfs->tfs_audio) { diff = tsfix_ts_diff(tf->tf_tsref, pkt->pkt_dts); if (diff > 2 * 90000) {