Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tsfix: don't set reference clocks when packet is incomplete (with error)
  • Loading branch information
perexg committed Aug 13, 2016
1 parent 414acf7 commit dc51bba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plumbing/tsfix.c
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit dc51bba

Please sign in to comment.