Changeset 5460 for pjproject/trunk/pjmedia/src/pjmedia/rtp.c
- Timestamp:
- Oct 13, 2016 11:49:57 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/rtp.c
r4235 r5460 150 150 unsigned *payloadlen) 151 151 { 152 pjmedia_rtp_dec_hdr dec_hdr; 153 154 return pjmedia_rtp_decode_rtp2(ses, pkt, pkt_len, hdr, &dec_hdr, 155 payload, payloadlen); 156 } 157 158 159 PJ_DEF(pj_status_t) pjmedia_rtp_decode_rtp2( 160 pjmedia_rtp_session *ses, 161 const void *pkt, int pkt_len, 162 const pjmedia_rtp_hdr **hdr, 163 pjmedia_rtp_dec_hdr *dec_hdr, 164 const void **payload, 165 unsigned *payloadlen) 166 { 152 167 int offset; 153 168 … … 165 180 offset = sizeof(pjmedia_rtp_hdr) + ((*hdr)->cc * sizeof(pj_uint32_t)); 166 181 167 /* Adjust offset if RTP extension is used. */182 /* Decode RTP extension. */ 168 183 if ((*hdr)->x) { 169 pjmedia_rtp_ext_hdr *ext = (pjmedia_rtp_ext_hdr*) 170 (((pj_uint8_t*)pkt) + offset); 171 offset += ((pj_ntohs(ext->length)+1) * sizeof(pj_uint32_t)); 184 dec_hdr->ext_hdr = (pjmedia_rtp_ext_hdr*)(((pj_uint8_t*)pkt) + offset); 185 dec_hdr->ext = (pj_uint32_t*)(dec_hdr->ext_hdr + 1); 186 dec_hdr->ext_len = pj_ntohs((dec_hdr->ext_hdr)->length); 187 offset += ((dec_hdr->ext_len + 1) * sizeof(pj_uint32_t)); 188 } else { 189 dec_hdr->ext_hdr = NULL; 190 dec_hdr->ext = NULL; 191 dec_hdr->ext_len = 0; 172 192 } 173 193
Note: See TracChangeset
for help on using the changeset viewer.