Mercurial > libavformat.hg
comparison sdp.c @ 5500:fc0a32a383d3 libavformat
Check the URL used for the SDP destination.
Patch by Martin Storsjo (martin AT martin DOT st)
author | lucabe |
---|---|
date | Thu, 07 Jan 2010 08:11:56 +0000 |
parents | 770a7de45356 |
children | 89259491d541 |
comparison
equal
deleted
inserted
replaced
5499:b63f760bb483 | 5500:fc0a32a383d3 |
---|---|
16 * You should have received a copy of the GNU Lesser General Public | 16 * You should have received a copy of the GNU Lesser General Public |
17 * License along with FFmpeg; if not, write to the Free Software | 17 * License along with FFmpeg; if not, write to the Free Software |
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 */ | 19 */ |
20 | 20 |
21 #include <string.h> | |
21 #include "libavutil/avstring.h" | 22 #include "libavutil/avstring.h" |
22 #include "libavutil/base64.h" | 23 #include "libavutil/base64.h" |
23 #include "avformat.h" | 24 #include "avformat.h" |
24 #include "internal.h" | 25 #include "internal.h" |
25 #include "avc.h" | 26 #include "avc.h" |
70 | 71 |
71 static int sdp_get_address(char *dest_addr, int size, int *ttl, const char *url) | 72 static int sdp_get_address(char *dest_addr, int size, int *ttl, const char *url) |
72 { | 73 { |
73 int port; | 74 int port; |
74 const char *p; | 75 const char *p; |
75 | 76 char proto[32]; |
76 url_split(NULL, 0, NULL, 0, dest_addr, size, &port, NULL, 0, url); | 77 |
78 url_split(proto, sizeof(proto), NULL, 0, dest_addr, size, &port, NULL, 0, url); | |
77 | 79 |
78 *ttl = 0; | 80 *ttl = 0; |
81 | |
82 if (strcmp(proto, "rtp")) { | |
83 /* The url isn't for the actual rtp sessions, | |
84 * don't parse out anything else than the destination. | |
85 */ | |
86 return 0; | |
87 } | |
88 | |
79 p = strchr(url, '?'); | 89 p = strchr(url, '?'); |
80 if (p) { | 90 if (p) { |
81 char buff[64]; | 91 char buff[64]; |
82 int is_multicast = find_info_tag(buff, sizeof(buff), "multicast", p); | 92 int is_multicast = find_info_tag(buff, sizeof(buff), "multicast", p); |
83 | 93 |