Changeset 3945 for pjproject/trunk/pjmedia/src/pjmedia/sdp.c
- Timestamp:
- Jan 27, 2012 9:12:59 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r3553 r3945 60 60 static void parse_connection_info(pj_scanner *scanner, pjmedia_sdp_conn *conn, 61 61 parse_context *ctx); 62 static void parse_bandwidth_info(pj_scanner *scanner, pjmedia_sdp_bandw *bandw, 63 parse_context *ctx); 62 64 static pjmedia_sdp_attr *parse_attr(pj_pool_t *pool, pj_scanner *scanner, 63 65 parse_context *ctx); … … 811 813 } 812 814 815 /* print optional bandwidth info. */ 816 for (i=0; i<ses->bandw_count; ++i) { 817 printed = print_bandw(ses->bandw[i], p, end-p); 818 if (printed < 1) { 819 return -1; 820 } 821 p += printed; 822 } 813 823 814 824 /* Time */ … … 987 997 pj_scan_get_until_chr(scanner, "/ \t\r\n", &conn->addr); 988 998 PJ_TODO(PARSE_SDP_CONN_ADDRESS_SUBFIELDS); 999 1000 /* We've got what we're looking for, skip anything until newline */ 1001 pj_scan_skip_line(scanner); 1002 } 1003 1004 static void parse_bandwidth_info(pj_scanner *scanner, pjmedia_sdp_bandw *bandw, 1005 parse_context *ctx) 1006 { 1007 pj_str_t str; 1008 1009 ctx->last_error = PJMEDIA_SDP_EINBANDW; 1010 1011 /* b= */ 1012 pj_scan_advance_n(scanner, 2, SKIP_WS); 1013 1014 /* modifier */ 1015 pj_scan_get_until_ch(scanner, ':', &bandw->modifier); 1016 pj_scan_get_char(scanner); 1017 1018 /* value */ 1019 pj_scan_get_until_chr(scanner, " \t\r\n", &str); 1020 bandw->value = pj_strtoul(&str); 989 1021 990 1022 /* We've got what we're looking for, skip anything until newline */ … … 1181 1213 pjmedia_sdp_attr *attr; 1182 1214 pjmedia_sdp_conn *conn; 1215 pjmedia_sdp_bandw *bandw; 1183 1216 pj_str_t dummy; 1184 1217 int cur_name = 254; … … 1254 1287 } 1255 1288 break; 1289 case 'b': 1290 bandw = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_bandw); 1291 parse_bandwidth_info(&scanner, bandw, &ctx); 1292 if (media) { 1293 media->bandw[media->bandw_count++] = bandw; 1294 } else { 1295 session->bandw[session->bandw_count++] = bandw; 1296 } 1297 break; 1256 1298 default: 1257 1299 if (cur_name >= 'a' && cur_name <= 'z') … … 1333 1375 } 1334 1376 1377 /* Duplicate bandwidth info */ 1378 sess->bandw_count = rhs->bandw_count; 1379 for (i=0; i<rhs->bandw_count; ++i) { 1380 sess->bandw[i] = pjmedia_sdp_bandw_clone(pool, rhs->bandw[i]); 1381 } 1382 1335 1383 /* Clone time line. */ 1336 1384 sess->time.start = rhs->time.start;
Note: See TracChangeset
for help on using the changeset viewer.