- Timestamp:
- Nov 9, 2009 5:18:12 AM (15 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/sdp.h
r2394 r2995 653 653 654 654 655 /** 656 * Add new attribute to the session descriptor. 657 * 658 * @param s The SDP session description. 659 * @param attr Attribute to add. 660 * 661 * @return PJ_SUCCESS or the appropriate error code. 662 */ 663 PJ_DECL(pj_status_t) pjmedia_sdp_session_add_attr(pjmedia_sdp_session *m, 664 pjmedia_sdp_attr *attr); 665 666 655 667 PJ_END_DECL 656 668 -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r2927 r2995 175 175 176 176 177 177 178 PJ_DEF(pj_status_t) pjmedia_sdp_attr_add(unsigned *count, 178 179 pjmedia_sdp_attr *attr_array[], … … 679 680 { 680 681 return pjmedia_sdp_attr_add(&m->attr_count, m->attr, attr); 682 } 683 684 PJ_DEF(pj_status_t) pjmedia_sdp_session_add_attr(pjmedia_sdp_session *s, 685 pjmedia_sdp_attr *attr) 686 { 687 return pjmedia_sdp_attr_add(&s->attr_count, s->attr, attr); 681 688 } 682 689 … … 979 986 med->desc.fmt_count = 0; 980 987 while (*scanner->curptr == ' ') { 988 pj_str_t fmt; 989 981 990 pj_scan_get_char(scanner); 982 991 … … 985 994 break; 986 995 987 pj_scan_get(scanner, &cs_token, &med->desc.fmt[med->desc.fmt_count++]); 996 pj_scan_get(scanner, &cs_token, &fmt); 997 if (med->desc.fmt_count < PJMEDIA_MAX_SDP_FMT) 998 med->desc.fmt[med->desc.fmt_count++] = fmt; 999 else 1000 PJ_PERROR(2,(THIS_FILE, PJ_ETOOMANY, 1001 "Error adding SDP media format %.*s, " 1002 "format is ignored", 1003 (int)fmt.slen, fmt.ptr)); 988 1004 } 989 1005 … … 1083 1099 if (attr) { 1084 1100 if (media) { 1085 media->attr[media->attr_count++] = attr;1101 pjmedia_sdp_media_add_attr(media, attr); 1086 1102 } else { 1087 session->attr[session->attr_count++] = attr;1103 pjmedia_sdp_session_add_attr(session, attr); 1088 1104 } 1089 1105 } … … 1110 1126 media = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); 1111 1127 parse_media(&scanner, media, &ctx); 1112 session->media[ session->media_count++ ] = media; 1128 if (session->media_count < PJMEDIA_MAX_SDP_MEDIA) 1129 session->media[ session->media_count++ ] = media; 1130 else 1131 PJ_PERROR(2,(THIS_FILE, PJ_ETOOMANY, 1132 "Error adding media, media is ignored")); 1113 1133 break; 1114 1134 case 'v': … … 1353 1373 static const pj_str_t ID_INACTIVE = { "inactive", 8 }; 1354 1374 1375 if (m->attr_count >= PJMEDIA_MAX_SDP_ATTR) 1376 return PJ_ETOOMANY; 1377 1355 1378 attr = pjmedia_sdp_attr_create(pool, ID_INACTIVE.ptr, NULL); 1356 1379 if (NULL == attr) 1357 1380 return PJ_ENOMEM; 1358 1381 1359 m->attr[m->attr_count++] = attr;1382 pjmedia_sdp_media_add_attr(m, attr); 1360 1383 m->desc.port = 0; 1361 1384
Note: See TracChangeset
for help on using the changeset viewer.