Commit be0a4188 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

RTP: ignore muxed RTCP packets for the time being

parent ce5b2bb7
...@@ -469,21 +469,28 @@ static int Demux (demux_t *demux) ...@@ -469,21 +469,28 @@ static int Demux (demux_t *demux)
block_t *block; block_t *block;
block = rtp_dgram_recv (demux, p_sys->fd); block = rtp_dgram_recv (demux, p_sys->fd);
if (block) if (!block)
{ return 1;
if (block->i_buffer < 2)
goto drop;
const uint8_t ptype = block->p_buffer[1] & 0x7F;
if (ptype >= 72 && ptype <= 76)
goto drop; /* Muxed RTCP, ignore for now */
/* Not using SDP, we need to guess the payload format used */ /* Not using SDP, we need to guess the payload format used */
/* see http://www.iana.org/assignments/rtp-parameters */ /* see http://www.iana.org/assignments/rtp-parameters */
if (p_sys->autodetect && block->i_buffer >= 2) if (p_sys->autodetect)
{ {
rtp_pt_t pt = { rtp_pt_t pt = {
.init = NULL, .init = NULL,
.destroy = codec_destroy, .destroy = codec_destroy,
.decode = codec_decode, .decode = codec_decode,
.frequency = 0, .frequency = 0,
.number = block->p_buffer[1] & 0x7f, .number = ptype,
}; };
switch (ptype)
switch (pt.number)
{ {
case 0: case 0:
msg_Dbg (demux, "detected G.711 mu-law"); msg_Dbg (demux, "detected G.711 mu-law");
...@@ -531,21 +538,16 @@ static int Demux (demux_t *demux) ...@@ -531,21 +538,16 @@ static int Demux (demux_t *demux)
pt.frequency = 90000; pt.frequency = 90000;
break; break;
case 72: /* muxed SR */
case 73: /* muxed RR */
case 74: /* muxed SDES */
case 75: /* muxed BYE */
case 76: /* muxed APP */
default: default:
block_Release (block); /* ooh! ignoring RTCP is evil! */ goto drop;
return 1;
} }
rtp_add_type (demux, p_sys->session, &pt); rtp_add_type (demux, p_sys->session, &pt);
p_sys->autodetect = false; p_sys->autodetect = false;
} }
rtp_receive (demux, p_sys->session, block); rtp_receive (demux, p_sys->session, block);
}
return 1;
drop:
block_Release (block);
return 1; return 1;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment