summaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
authorJosh Allmann <joshua.allmann@gmail.com>2010-08-25 09:15:31 +0000
committerMartin Storsjö <martin@martin.st>2010-08-25 09:15:31 +0000
commit7f3468d3923b1703e0e4f7f534e7c68728f4393e (patch)
treeeaffa2daaa61549c7ea4f2af34a41d8f8b01e2c1 /libavformat/rtpdec.c
parentd21caa952c47e004c40ab62ef5239dc5fd6726ed (diff)
downloadffmpeg-streaming-7f3468d3923b1703e0e4f7f534e7c68728f4393e.zip
ffmpeg-streaming-7f3468d3923b1703e0e4f7f534e7c68728f4393e.tar.gz
rtp: Replace hardcoded RTCP packet types with defines
Patch by Josh Allmann, joshua dot allmann at gmail Originally committed as revision 24912 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 63dda0c..83cc687 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -74,7 +74,7 @@ void av_register_rtp_dynamic_payload_handlers(void)
static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int len)
{
- if (buf[1] != 200)
+ if (buf[1] != RTCP_SR)
return -1;
s->last_rtcp_ntp_time = AV_RB64(buf + 8);
if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE)
@@ -209,7 +209,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
// Receiver Report
put_byte(pb, (RTP_VERSION << 6) + 1); /* 1 report block */
- put_byte(pb, 201);
+ put_byte(pb, RTCP_RR);
put_be16(pb, 7); /* length in words - 1 */
// our own SSRC: we use the server's SSRC + 1 to avoid conflicts
put_be32(pb, s->ssrc + 1);
@@ -248,7 +248,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
// CNAME
put_byte(pb, (RTP_VERSION << 6) + 1); /* 1 report block */
- put_byte(pb, 202);
+ put_byte(pb, RTCP_SDES);
len = strlen(s->hostname);
put_be16(pb, (6 + len + 3) / 4); /* length in words - 1 */
put_be32(pb, s->ssrc);
@@ -299,7 +299,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
return;
put_byte(pb, (RTP_VERSION << 6));
- put_byte(pb, 201); /* receiver report */
+ put_byte(pb, RTCP_RR); /* receiver report */
put_be16(pb, 1); /* length in words - 1 */
put_be32(pb, 0); /* our own SSRC */
@@ -434,7 +434,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
if ((buf[0] & 0xc0) != (RTP_VERSION << 6))
return -1;
- if (buf[1] >= 200 && buf[1] <= 204) {
+ if (buf[1] >= RTCP_SR && buf[1] <= RTCP_APP) {
rtcp_parse_packet(s, buf, len);
return -1;
}
OpenPOWER on IntegriCloud