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);
+ if (strcmp(buf1, "incl"))
+ return;
+
+ get_word(buf1, sizeof(buf1), &p);
+ if (strcmp(buf1, "IN") != 0)
+ return;
+ get_word(buf1, sizeof(buf1), &p);
+ if (strcmp(buf1, "IP4") && strcmp(buf1, "IP6"))
+ return;
+ // not checking that the destination address actually matches
+ get_word(buf1, sizeof(buf1), &p);
+
+ rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
+ 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);
"?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->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;