| 530 | } |
| 531 | |
| 532 | static int sdp_parse(AVFormatContext *s, const char *content) |
| 533 | { |
| 534 | const char *p; |
| 535 | int letter; |
| 536 | /* Some SDP lines, particularly for Realmedia or ASF RTSP streams, |
| 537 | * contain long SDP lines containing complete ASF Headers (several |
| 538 | * kB) or arrays of MDPR (RM stream descriptor) headers plus |
| 539 | * "rulebooks" describing their properties. Therefore, the SDP line |
| 540 | * buffer is large. |
| 541 | * |
| 542 | * The Vorbis FMTP line can be up to 16KB - see sdp_parse_fmtp. */ |
| 543 | char buf[16384], *q; |
| 544 | SDPParseState sdp_parse_state, *s1 = &sdp_parse_state; |
| 545 | |
| 546 | memset(s1, 0, sizeof(SDPParseState)); |
| 547 | p = content; |
| 548 | for (;;) { |
| 549 | skip_spaces(&p); |
| 550 | letter = *p; |
| 551 | if (letter == '\0') |
| 552 | break; |
| 553 | p++; |
| 554 | if (*p != '=') |
| 555 | goto next_line; |
| 556 | p++; |
| 557 | /* get the content */ |
| 558 | q = buf; |
| 559 | while (*p != '\n' && *p != '\r' && *p != '\0') { |
| 560 | if ((q - buf) < sizeof(buf) - 1) |
| 561 | *q++ = *p; |
| 562 | p++; |
| 563 | } |
| 564 | *q = '\0'; |
| 565 | sdp_parse_line(s, s1, letter, buf); |
| 566 | next_line: |
| 567 | while (*p != '\n' && *p != '\0') |
| 568 | p++; |
| 569 | if (*p == '\n') |
| 570 | p++; |
| 571 | } |
| 572 | return 0; |
| 573 | } |
| 574 | |
| 575 | /* close and free RTSP streams */ |
| 576 | void ff_rtsp_close_streams(AVFormatContext *s) |
no test coverage detected