summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-20 10:37:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-20 10:39:53 +0200
commit48353325372ae7c1721c55bafe33cf0816301a5e (patch)
tree02c84e6d19e4caba3afb91dbb5771cea7216dcb2 /libavformat/rtsp.c
parent73b2043d727029ecde19c1d92bda8411f18b8e55 (diff)
parent36fb0d02a1faa11eaee51de01fb4061ad6092af9 (diff)
Merge commit '36fb0d02a1faa11eaee51de01fb4061ad6092af9'
* commit '36fb0d02a1faa11eaee51de01fb4061ad6092af9': rtsp: Support multicast source filters (RFC 4570) rtpproto: Check the source IP if one single source has been specified rtpproto: Support IGMPv3 source specific multicast inclusion Conflicts: libavformat/rtpproto.c libavformat/rtsp.c libavformat/rtsp.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index ff3b74079b..af574f131f 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -498,23 +498,22 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
p += strspn(p, SPACE_CHARS);
if (av_strstart(p, "inline:", &p))
get_word(rtsp_st->crypto_params, sizeof(rtsp_st->crypto_params), &p);
- } else if (av_strstart(p, "source-filter", &p) && s->nb_streams > 0) {
- get_word(buf1, sizeof(buf1), &p); // ignore tag
+ } else if (av_strstart(p, "source-filter:", &p) && s->nb_streams > 0) {
+ get_word(buf1, sizeof(buf1), &p);
+ if (strcmp(buf1, "incl"))
+ return;
get_word(buf1, sizeof(buf1), &p);
if (strcmp(buf1, "IN") != 0)
- return;
+ return;
get_word(buf1, sizeof(buf1), &p);
if (strcmp(buf1, "IP4") && strcmp(buf1, "IP6"))
- return;
- get_word(buf1, sizeof(buf1), &p); //ignore repeated multicast address
+ return;
+ // not checking that the destination address actually matches
get_word(buf1, sizeof(buf1), &p);
- if (get_sockaddr(buf1, &sdp_ip))
- return;
rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
- rtsp_st->ssm = 1;
- rtsp_st->source_ip = sdp_ip;
+ get_word(rtsp_st->source_addr, sizeof(rtsp_st->source_addr), &p);
} else {
if (rt->server_type == RTSP_SERVER_WMS)
ff_wms_parse_sdp_a_line(s, p);
@@ -2101,11 +2100,8 @@ static int sdp_read_header(AVFormatContext *s)
"?localport=%d&ttl=%d&connect=%d", rtsp_st->sdp_port,
rtsp_st->sdp_ttl,
rt->rtsp_flags & RTSP_FLAG_FILTER_SRC ? 1 : 0);
- if (rtsp_st->ssm) {
- getnameinfo((struct sockaddr*) &rtsp_st->source_ip, sizeof(rtsp_st->source_ip),
- namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
- av_strlcatf(url, sizeof(url), "&ssm=%s", namebuf);
- }
+ if (rtsp_st->source_addr[0])
+ av_strlcatf(url, sizeof(url), "&sources=%s", rtsp_st->source_addr);
if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
&s->interrupt_callback, NULL) < 0) {
err = AVERROR_INVALIDDATA;