Revision a92c30d7

View differences:

doc/protocols.texi
251 251
@item http
252 252
Use HTTP tunneling as lower transport protocol, which is useful for
253 253
passing proxies.
254

  
255
@item filter_src
256
Accept packets only from negotiated peer address and port.
254 257
@end table
255 258

  
256 259
Multiple lower transport protocols may be specified, in that case they are
libavformat/rtsp.c
1186 1186
            break;
1187 1187

  
1188 1188
        case RTSP_LOWER_TRANSPORT_UDP: {
1189
            char url[1024];
1189
            char url[1024], options[30] = "";
1190 1190

  
1191
            if (rt->filter_source)
1192
                av_strlcpy(options, "?connect=1", sizeof(options));
1191 1193
            /* Use source address if specified */
1192 1194
            if (reply->transports[0].source[0]) {
1193 1195
                ff_url_join(url, sizeof(url), "rtp", NULL,
1194 1196
                            reply->transports[0].source,
1195
                            reply->transports[0].server_port_min, NULL);
1197
                            reply->transports[0].server_port_min, options);
1196 1198
            } else {
1197 1199
                ff_url_join(url, sizeof(url), "rtp", NULL, host,
1198
                            reply->transports[0].server_port_min, NULL);
1200
                            reply->transports[0].server_port_min, options);
1199 1201
            }
1200 1202
            if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) &&
1201 1203
                rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) {
......
1315 1317
            } else if(!strcmp(option, "http")) {
1316 1318
                lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_TCP);
1317 1319
                rt->control_transport = RTSP_MODE_TUNNEL;
1320
            } else if (!strcmp(option, "filter_src")) {
1321
                rt->filter_source = 1;
1318 1322
            } else {
1319 1323
                /* Write options back into the buffer, using memmove instead
1320 1324
                 * of strcpy since the strings may overlap. */
libavformat/rtsp.h
309 309

  
310 310
    /** Reusable buffer for receiving packets */
311 311
    uint8_t* recvbuf;
312

  
313
    /** Filter incoming UDP packets - receive packets only from the right
314
     * source address and port. */
315
    int filter_source;
312 316
} RTSPState;
313 317

  
314 318
/**

Also available in: Unified diff