- Timestamp:
- Oct 16, 2006 4:43:25 PM (18 years ago)
- Location:
- pjproject/trunk/pjmedia/src/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r732 r775 341 341 attr->value.slen = 342 342 pj_ansi_snprintf(attr->value.ptr, 80, 343 " :%u IN IP4 %s",343 "%u IN IP4 %s", 344 344 pj_ntohs(sock_info[0].rtcp_addr_name.sin_port), 345 345 pj_inet_ntoa(sock_info[0].rtcp_addr_name.sin_addr)); … … 404 404 attr->value.slen = 405 405 pj_ansi_snprintf( attr->value.ptr, 32, 406 " :%d mode=%d",406 "%d mode=%d", 407 407 codec_info->pt, 408 408 codec_param.setting.dec_fmtp_mode); … … 428 428 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); 429 429 attr->name = pj_str("rtpmap"); 430 attr->value = pj_str( ":"PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR430 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 431 431 " telephone-event/8000"); 432 432 m->attr[m->attr_count++] = attr; … … 435 435 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); 436 436 attr->name = pj_str("fmtp"); 437 attr->value = pj_str( ":"PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15");437 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15"); 438 438 m->attr[m->attr_count++] = attr; 439 439 #endif -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r730 r775 138 138 const pj_str_t *c_fmt) 139 139 { 140 char fmtbuf[16];141 pj_str_t fmt = { NULL, 0};142 140 unsigned i; 143 144 if (c_fmt) {145 /* To search the format, we prepend the string with a colon and146 * append space147 */148 PJ_ASSERT_RETURN(c_fmt->slen<sizeof(fmtbuf)-2, NULL);149 fmt.ptr = fmtbuf;150 fmt.slen = c_fmt->slen + 2;151 fmtbuf[0] = ':';152 pj_memcpy(fmt.ptr+1, c_fmt->ptr, c_fmt->slen);153 fmtbuf[c_fmt->slen+1] = ' ';154 155 }156 141 157 142 for (i=0; i<count; ++i) { … … 159 144 const pjmedia_sdp_attr *a = attr_array[i]; 160 145 if (c_fmt) { 161 if (a->value.slen > fmt.slen &&162 pj_strncmp(&a->value, &fmt, fmt.slen)==0)146 if (a->value.slen > c_fmt->slen && 147 pj_strncmp(&a->value, c_fmt, c_fmt->slen)==0) 163 148 { 164 149 return (pjmedia_sdp_attr*)a; … … 290 275 /* Parse */ 291 276 PJ_TRY { 292 /* Eat the first ':' */293 if (pj_scan_get_char(&scanner) != ':') {294 status = PJMEDIA_SDP_EINRTPMAP;295 goto on_return;296 }297 298 277 299 278 /* Get payload type. */ … … 353 332 */ 354 333 355 /* Eat the first ':' */356 if (*p != ':') return PJMEDIA_SDP_EINFMTP;357 358 /* Get ':' */359 ++p;360 361 334 /* Get format. */ 362 335 token.ptr = (char*)p; … … 406 379 PJ_TRY { 407 380 408 /* Get the first ":" */409 if (pj_scan_get_char(&scanner) != ':')410 {411 status = PJMEDIA_SDP_EINRTCP;412 goto on_return;413 }414 415 381 /* Get the port */ 416 382 pj_scan_get(&scanner, &cs_token, &token); … … 439 405 PJ_END; 440 406 441 on_return:442 407 pj_scan_fini(&scanner); 443 408 return status; … … 464 429 { 465 430 pjmedia_sdp_attr *attr; 466 char tempbuf[ 64];431 char tempbuf[128]; 467 432 int len; 468 433 … … 483 448 /* Format: ":pt enc_name/clock_rate[/param]" */ 484 449 len = pj_ansi_snprintf(tempbuf, sizeof(tempbuf), 485 " :%.*s %.*s/%u%s%.*s",450 "%.*s %.*s/%u%s%.*s", 486 451 (int)rtpmap->pt.slen, 487 452 rtpmap->pt.ptr, … … 551 516 552 517 if (attr->value.slen) { 518 *p++ = ':'; 553 519 pj_memcpy(p, attr->value.ptr, attr->value.slen); 554 520 p += attr->value.slen; … … 1008 974 1009 975 if (*scanner->curptr != '\r' && *scanner->curptr != '\n') { 976 /* skip ':' if present. */ 977 if (*scanner->curptr == ':') 978 pj_scan_get_char(scanner); 979 1010 980 /* get value */ 1011 pj_scan_get_until_ch(scanner, '\r', &attr->value); 981 if (*scanner->curptr != '\r') { 982 pj_scan_get_until_ch(scanner, '\r', &attr->value); 983 } else { 984 attr->value.ptr = NULL; 985 attr->value.slen = 0; 986 } 987 1012 988 } else { 1013 989 attr->value.ptr = NULL;
Note: See TracChangeset
for help on using the changeset viewer.