Skip to content

Commit 6ae9098

Browse files
funmancmassiot
authored andcommitted
rtp and fec: drop RTCP packets
1 parent b9ef60b commit 6ae9098

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/upipe-modules/upipe_rtp_decaps.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,13 @@ static inline void upipe_rtpd_input(struct upipe *upipe, struct uref *uref,
660660
}
661661
uref_block_resize(uref, offset, -1);
662662

663+
if (type >= 72 && type <= 95 && marker) {
664+
upipe_warn_va(upipe, "Payload type %d is probably RTCP, dropping",
665+
type + 128);
666+
uref_free(uref);
667+
return;
668+
}
669+
663670
if (unlikely(upipe_rtpd->expected_seqnum != -1 &&
664671
seqnum != upipe_rtpd->expected_seqnum)) {
665672
upipe_dbg_va(upipe, "potentially lost %d RTP packets, got %u expected %u",

lib/upipe-ts/upipe_rtp_fec.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,15 @@ static void upipe_rtp_fec_sub_input(struct upipe *upipe, struct uref *uref,
791791
return;
792792
}
793793

794+
bool marker = rtp_check_marker(rtp_header);
795+
uint8_t type = rtp_get_type(rtp_header);
796+
if (type >= 72 && type <= 95 && marker) {
797+
upipe_warn_va(upipe, "Payload type %d is probably RTCP, dropping",
798+
type + 128);
799+
uref_free(uref);
800+
return;
801+
}
802+
794803
uref->priv = rtp_get_seqnum(rtp_header);
795804
uref_block_peek_unmap(uref, 0, rtp_buffer, rtp_header);
796805

0 commit comments

Comments
 (0)